Notification wird nicht abgeschickt

  • Antworten:2
  • Bentwortet
Luca T.
  • Forum-Beiträge: 62

25.08.2014, 22:05:10 via Website

Hallo Leute,

ich möchte eine Notification abschicken, aber irgendwie klappt das nicht. Kann mir einer sagen was in dem Code fehlt/falsch ist?

NotificationCompat.Builder b  = new NotificationCompat.Builder(getApplicationContext());
        b.setContentTitle("Test");
        b.setContentText("Test");
        b.setContentIntent(pIntent);
        b.setAutoCancel(true).build();

Notification n = b.build();

NotificationManager notificationManager = 
  (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

notificationManager.notify(0, n);

Antworten
Luca T.
  • Forum-Beiträge: 62

25.08.2014, 22:08:37 via Website

Tschuldigung, war das Bild das ich vergessen habe, funktioniert jetzt

Antworten
Jakob N.
  • Forum-Beiträge: 282

25.08.2014, 22:42:51 via App

Notification muss glaub ich Icon, Title und Text haben.

LG Jakob

Antworten