From e947075d218e8ad4176a2a4ec384d6f1ef67e78b Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 7 Nov 2015 11:12:39 -0800 Subject: #592 Fix recent podcasts not showing up on rotate --- .../daneren2005/dsub/fragments/SelectPodcastsFragment.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java index a76470dd..1f677597 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java @@ -63,6 +63,18 @@ public class SelectPodcastsFragment extends SelectRecyclerFragment if (Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_LARGE_ALBUM_ART, true) && hasCoverArt) { largeAlbums = true; } + + if(bundle != null && serialize) { + newestEpisodes = (MusicDirectory) bundle.getSerializable(Constants.FRAGMENT_LIST2); + } + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + if(serialize) { + outState.putSerializable(Constants.FRAGMENT_LIST2, newestEpisodes); + } } @Override @@ -143,7 +155,7 @@ public class SelectPodcastsFragment extends SelectRecyclerFragment } else { List headers = Arrays.asList(PodcastChannelAdapter.EPISODE_HEADER, PodcastChannelAdapter.CHANNEL_HEADER); - List episodes = newestEpisodes.getChildren(); + List episodes = newestEpisodes.getChildren(false, true); List serializableEpisodes = new ArrayList<>(); // Put 3 in current list -- cgit v1.2.3