fix back on main activity
This commit is contained in:
parent
76b5c99f7f
commit
c6d17d7589
2 changed files with 2 additions and 5 deletions
|
|
@ -41,7 +41,6 @@ public class PlayingNotificationImpl extends PlayingNotification {
|
||||||
stopped = false;
|
stopped = false;
|
||||||
|
|
||||||
final Song song = service.getCurrentSong();
|
final Song song = service.getCurrentSong();
|
||||||
|
|
||||||
final boolean isPlaying = service.isPlaying();
|
final boolean isPlaying = service.isPlaying();
|
||||||
|
|
||||||
final RemoteViews notificationLayout = new RemoteViews(service.getPackageName(), R.layout.notification);
|
final RemoteViews notificationLayout = new RemoteViews(service.getPackageName(), R.layout.notification);
|
||||||
|
|
@ -124,6 +123,7 @@ public class PlayingNotificationImpl extends PlayingNotification {
|
||||||
if (!PreferenceUtil.getInstance(service).getColoredNotification()) {
|
if (!PreferenceUtil.getInstance(service).getColoredNotification()) {
|
||||||
bgColor = Color.WHITE;
|
bgColor = Color.WHITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
setBackgroundColor(bgColor);
|
setBackgroundColor(bgColor);
|
||||||
setNotificationContent(ColorUtil.isColorLight(bgColor));
|
setNotificationContent(ColorUtil.isColorLight(bgColor));
|
||||||
|
|
||||||
|
|
@ -169,17 +169,14 @@ public class PlayingNotificationImpl extends PlayingNotification {
|
||||||
|
|
||||||
final ComponentName serviceName = new ComponentName(service, MusicService.class);
|
final ComponentName serviceName = new ComponentName(service, MusicService.class);
|
||||||
|
|
||||||
// previous track
|
|
||||||
pendingIntent = buildPendingIntent(service, MusicService.ACTION_REWIND, serviceName);
|
pendingIntent = buildPendingIntent(service, MusicService.ACTION_REWIND, serviceName);
|
||||||
notificationLayout.setOnClickPendingIntent(R.id.action_prev, pendingIntent);
|
notificationLayout.setOnClickPendingIntent(R.id.action_prev, pendingIntent);
|
||||||
notificationLayoutBig.setOnClickPendingIntent(R.id.action_prev, pendingIntent);
|
notificationLayoutBig.setOnClickPendingIntent(R.id.action_prev, pendingIntent);
|
||||||
|
|
||||||
// toggle play and pause
|
|
||||||
pendingIntent = buildPendingIntent(service, MusicService.ACTION_TOGGLE, serviceName);
|
pendingIntent = buildPendingIntent(service, MusicService.ACTION_TOGGLE, serviceName);
|
||||||
notificationLayout.setOnClickPendingIntent(R.id.action_play_pause, pendingIntent);
|
notificationLayout.setOnClickPendingIntent(R.id.action_play_pause, pendingIntent);
|
||||||
notificationLayoutBig.setOnClickPendingIntent(R.id.action_play_pause, pendingIntent);
|
notificationLayoutBig.setOnClickPendingIntent(R.id.action_play_pause, pendingIntent);
|
||||||
|
|
||||||
// next track
|
|
||||||
pendingIntent = buildPendingIntent(service, MusicService.ACTION_SKIP, serviceName);
|
pendingIntent = buildPendingIntent(service, MusicService.ACTION_SKIP, serviceName);
|
||||||
notificationLayout.setOnClickPendingIntent(R.id.action_next, pendingIntent);
|
notificationLayout.setOnClickPendingIntent(R.id.action_next, pendingIntent);
|
||||||
notificationLayoutBig.setOnClickPendingIntent(R.id.action_next, pendingIntent);
|
notificationLayoutBig.setOnClickPendingIntent(R.id.action_next, pendingIntent);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class NavigationUtil {
|
||||||
public static void goToMain(@NonNull final Context context) {
|
public static void goToMain(@NonNull final Context context) {
|
||||||
final Intent intent = new Intent(context, MainActivity.class);
|
final Intent intent = new Intent(context, MainActivity.class);
|
||||||
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue