playbackservice is now only in the foreground while playing
This commit is contained in:
parent
81295bc07f
commit
7ef8a7021c
|
@ -196,7 +196,6 @@ public class PlaybackService extends Service {
|
||||||
Log.w(TAG, "Something went wrong. Shutting down...");
|
Log.w(TAG, "Something went wrong. Shutting down...");
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
setupNotification();
|
|
||||||
return Service.START_STICKY;
|
return Service.START_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +304,7 @@ public class PlaybackService extends Service {
|
||||||
sendBroadcast(new Intent(ACTION_PLAYER_STATUS_CHANGED));
|
sendBroadcast(new Intent(ACTION_PLAYER_STATUS_CHANGED));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Prepares notification and starts the service in the foreground. */
|
||||||
private void setupNotification() {
|
private void setupNotification() {
|
||||||
PendingIntent pIntent = PendingIntent.getActivity(this, 0, new Intent(
|
PendingIntent pIntent = PendingIntent.getActivity(this, 0, new Intent(
|
||||||
this, MediaplayerActivity.class),
|
this, MediaplayerActivity.class),
|
||||||
|
|
Loading…
Reference in New Issue