diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-08-08 13:29:15 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-08-08 13:29:15 -0400 |
commit | 57fde20d71f5d766e5e1fa50ccbcb2bda5357cb3 (patch) | |
tree | 488c71c93196b58054cacbffebdfd8e3bf11987a | |
parent | d98ab3a8e95372c66dad7a4702ab6511af6d7f6f (diff) | |
parent | c5357d075833efd1accb9010386d62ef43e4dea3 (diff) | |
download | AntennaPod-57fde20d71f5d766e5e1fa50ccbcb2bda5357cb3.zip |
Merge pull request #1066 from TomHennen/resolve_race_condition
create PreferenceController before the main fragment
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java | 7 |
1 files 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 |