fix dummy service start
This commit is contained in:
parent
b950a10938
commit
6ccf3788be
1 changed files with 5 additions and 3 deletions
|
@ -29,9 +29,7 @@ public class DummyService extends Service {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
Notification notification = PersistentNotificationPlugin.getPlugin().updateNotification();
|
super.onStartCommand(intent, flags, startId);
|
||||||
if (notification != null)
|
|
||||||
startForeground(PersistentNotificationPlugin.ONGOING_NOTIFICATION_ID, notification);
|
|
||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +43,10 @@ public class DummyService extends Service {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
Notification notification = PersistentNotificationPlugin.getPlugin().updateNotification();
|
||||||
|
if (notification != null)
|
||||||
|
startForeground(PersistentNotificationPlugin.ONGOING_NOTIFICATION_ID, notification);
|
||||||
MainApp.bus().register(this);
|
MainApp.bus().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue