From a31e11c8a08033f7a15947d21d494f32323f202a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 7 Aug 2014 13:42:19 -0700 Subject: #383 Add intents to go to sync notification's action --- .../daneren2005/dsub/util/Notifications.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/util/Notifications.java b/src/github/daneren2005/dsub/util/Notifications.java index a070b37a..67eb4626 100644 --- a/src/github/daneren2005/dsub/util/Notifications.java +++ b/src/github/daneren2005/dsub/util/Notifications.java @@ -311,6 +311,29 @@ public final class Notifications { Intent notificationIntent = new Intent(context, SubsonicFragmentActivity.class); notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + + String tab, type; + switch(stringId) { + case R.string.sync_new_albums: + type = "newest"; + break; + case R.string.sync_new_playlists: + tab = "Playlist"; + break; + case R.string.sync_new_podcasts: + tab = "Podcast"; + break; + case R.string.sync_new_starred: + type = "starred"; + break; + } + if(tab != null) { + notificationIntent.putExtra(Constants.INTENT_EXTRA_FRAGMENT_TYPE, tab); + } + if(type != null) { + notificationIntent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE, type); + } + builder.setContentIntent(PendingIntent.getActivity(context, 2, notificationIntent, 0)); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); -- cgit v1.2.3