2014-02-20 5 views
0

Я пытаюсь показать форму уведомления моего IntentService.Попытка с уведомлением

Но ничего не показывает: - ((((

public class CreditcheckService extends IntentService { 
    AlertDialog dialog; 
    public CreditcheckService() { 
     super("CreditcheckService"); 
    } 

    @Override 
    protected void onHandleIntent(Intent intent) { 
     NotificationCompat.Builder mBuilder = 
      new NotificationCompat.Builder(this) 
      .setSmallIcon(R.drawable.icon) 
      .setContentTitle("My notification") 
      .setContentText("Hello World!"); 
     NotificationManager mNotificationManager = 
      (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 
     mNotificationManager.notify(999, mBuilder.build()); 
} 
+0

ли ваш код уведомления работать с мероприятия? – Merlevede

ответ

2

OK

Я добавил следующее:

mBuilder.setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0, new Intent(), 0)); 

И это работает ...

Смежные вопросы