Merge pull request #1066 from TomHennen/resolve_race_condition

create PreferenceController before the main fragment
This commit is contained in:
Tom Hennen 2015-08-08 13:29:15 -04:00
commit 57fde20d71
1 changed files with 5 additions and 2 deletions

View File

@ -60,10 +60,13 @@ public class PreferenceActivity extends ActionBarActivity {
root.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
setContentView(root);
// 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();
preferenceController = new PreferenceController(preferenceUI);
}
@Override