From c5357d075833efd1accb9010386d62ef43e4dea3 Mon Sep 17 00:00:00 2001 From: Tom Hennen Date: Wed, 5 Aug 2015 21:43:38 -0400 Subject: create PreferenceController before the main fragment --- .../java/de/danoeh/antennapod/activity/PreferenceActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java index 3802de2a6..94970d833 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -60,10 +60,13 @@ public class PreferenceActivity extends ActionBarActivity { root.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); setContentView(root); - prefFragment = new MainFragment(); - getFragmentManager().beginTransaction().replace(R.id.content, prefFragment).commit(); + // we need to create the PreferenceController before the MainFragment + // since the MainFragment depends on the preferenceController already being created preferenceController = new PreferenceController(preferenceUI); + + prefFragment = new MainFragment(); + getFragmentManager().beginTransaction().replace(R.id.content, prefFragment).commit(); } @Override -- cgit v1.2.3