Android Service Notification

  • Antworten:0
Martin Grulich
  • Forum-Beiträge: 56

13.05.2011, 19:09:51 via Website

Hi Leute,

ich habe einen Service. Dort habe ich im OnCreate folgendes definiert:
1mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
2 notification = new Notification(
3 R.drawable.icon,
4 "Dies ist eine Testnachricht",
5 System.currentTimeMillis());
6startservice();

Und startservice sieht so aus:
1private void startservice() {
2 timer.scheduleAtFixedRate(
3 new TimerTask() {
4 public void run() {
5 mNotificationManager.notify(ReportsList.MESSAGE_ID, notification);
6 Log.d("DE-APP", "notified ?!");
7 }
8 },
9 1000,
10 10000);

Allerdings sehe ich nirgends die Notification, was mache ich falsch ?!

Danke & Gruß Martin

— geändert am 13.05.2011, 19:12:12

Antworten