Dienst wird vom ActivityManager beendet

J

jskeletti

Fortgeschrittenes Mitglied
19
Ich habe das Problem, dass mein Dienst vom ActivityManager beendet wird. Und das obwohl ich ihn mit

Code:
@Override
protected void onHandleIntent(Intent intent) {
  Notification notification = new Notification(R.drawable.ic_launcher, getText(R.string.app_name), System.currentTimeMillis());
   Intent notificationIntent = new Intent(this, LocateService.class);
   PendingIntent pendingIntent = PendingIntent.getService(this, 0, notificationIntent, 0);
   notification.setLatestEventInfo(this, getText(R.string.app_name), getText(R.string.app_name), pendingIntent);
   startForeground(666, notification);
}
anweise, dass er im Vordergrund laufen soll und damit nicht beendet werden soll. Die meldung im Logcat lautet:
03-01 13:32:17.976: I/ActivityManager(210): No longer want bla.blub.service (pid 1252): hidden #16

Hat jemand einen Tipp was ich falsch mache?
 
Niemand eine Idee?
 
Es muss doch jemand etwas darüber bescheid wissen!
 
Hab das jetzt selbst gelöst. Falls es einen interessiert: Hab diesen Quellcode an meinen Service angepasst und onStartCommand() von hier hinzugefügt.
 

Ähnliche Themen

M
  • MikelKatzengreis
Antworten
10
Aufrufe
226
swa00
swa00
OnkelLon
Antworten
7
Aufrufe
1.208
thomaspan
thomaspan
H
  • HerrFatalVonError
Antworten
4
Aufrufe
788
jogimuc
J
Zurück
Oben Unten