From 494b34d4219110305c56a2c5bba75bcebb001cb4 Mon Sep 17 00:00:00 2001 From: pachecosf Date: Tue, 22 Jan 2019 23:57:37 -0800 Subject: [PATCH] fixed losing media images and descriptions on rotate --- .../de/danoeh/antennapod/activity/MediaplayerInfoActivity.java | 1 + .../main/java/de/danoeh/antennapod/fragment/CoverFragment.java | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java index a2389dabd..3db00edc9 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java @@ -278,6 +278,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem butCastDisconnect = findViewById(R.id.butCastDisconnect); pager = findViewById(R.id.pager); + pager.setOffscreenPageLimit(3); pagerAdapter = new MediaplayerInfoPagerAdapter(getSupportFragmentManager(), media); pagerAdapter.setController(controller); pager.setAdapter(pagerAdapter); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 5a061c7e6..ef65a5755 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -48,6 +48,7 @@ public class CoverFragment extends Fragment implements MediaplayerInfoContentFra @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + setRetainInstance(true); root = inflater.inflate(R.layout.cover_fragment, container, false); txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle); txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle);