Notification ohne PendingEvent weiterleitung möglich ?

  • Antworten:3
Mac Systems
  • Forum-Beiträge: 1.727

07.09.2009, 16:30:09 via Website

Ich würde dem User gerne Visuell zeigen das die APP im Hintergrund arbeitet, ohne direkt einen weiteren PendingIntent zu definieren der dann bei Klick auf eine Activity weiterleitet. Geht so was überhaupt ? Oder sehe Ich den Wald vor lauter Bäumen nicht ?

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

07.09.2009, 16:34:18 via Website

Folgendes habe Ich probiert:

1final CharSequence tickerText = "Hello"; // ticker-text long when = System.currentTimeMillis(); // notification time final CharSequence contentTitle = "My notification"; // expanded message // title final CharSequence contentText = "Hello World!"; // expanded message // text
2 //final Intent notificationIntent = new Intent(context, OngoingUpdate.class); //PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
3 final Notification notification = new Notification(R.drawable.icon_update, tickerText, when); notification.flags |= Notification.FLAG_NO_CLEAR| Notification.FLAG_ONGOING_EVENT; notification.setLatestEventInfo(context, contentTitle, contentText, null);
4 notificationManager.notify(alarmID, notification); return alarmID;


Leider passsiert bei übergabe von null einfach nichts mehr.

1notification.setLatestEventInfo(context, contentTitle, contentText, null);

PS: Wann fixt jemand das Sourcecode formatieren ? Es nervt tierisch!

— geändert am 07.09.2009, 16:34:55

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Gelöschter Account
  • Forum-Beiträge: 5.136

07.09.2009, 18:44:17 via Website

Soweit mir das bekannt ist, brauchst Du diesen pending Intent ...

Ich hab das synonym bei mir auch so lösen müssen.

lg
Voss

lg Voss

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

08.09.2009, 14:28:09 via Website

Irgendeine Dummy Activity zu schreiben ist auch nicht gerade das gelbe vom Ei :/

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten