create PreferenceController before the main fragment

This commit is contained in:
Tom Hennen 2015-08-05 21:43:38 -04:00
parent f13615d46a
commit c5357d0758

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