J
jskeletti
Fortgeschrittenes Mitglied
- 19
Ich habe das Problem, dass mein Dienst vom ActivityManager beendet wird. Und das obwohl ich ihn mit
anweise, dass er im Vordergrund laufen soll und damit nicht beendet werden soll. Die meldung im Logcat lautet:
Hat jemand einen Tipp was ich falsch mache?
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);
}
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?