always run startForeground()
This commit is contained in:
parent
df2ae1c52f
commit
1512064c53
1 changed files with 6 additions and 2 deletions
|
@ -4,6 +4,7 @@ import android.app.Notification;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.squareup.otto.Subscribe;
|
import com.squareup.otto.Subscribe;
|
||||||
|
@ -45,7 +46,10 @@ public class DummyService extends Service {
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
Notification notification = PersistentNotificationPlugin.getPlugin().updateNotification();
|
Notification notification = PersistentNotificationPlugin.getPlugin().updateNotification();
|
||||||
if (notification != null)
|
if (notification == null) {
|
||||||
|
log.debug("notification==null");
|
||||||
|
notification = new Notification();
|
||||||
|
}
|
||||||
startForeground(PersistentNotificationPlugin.ONGOING_NOTIFICATION_ID, notification);
|
startForeground(PersistentNotificationPlugin.ONGOING_NOTIFICATION_ID, notification);
|
||||||
MainApp.bus().register(this);
|
MainApp.bus().register(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue