forked from upstream-mirrors/quik
Fixed crash when viewing sub-settings page
This commit is contained in:
@@ -310,7 +310,8 @@ public class MainActivity extends QKActivity implements SlidingMenu.SlidingMenuL
|
|||||||
if (!mSlidingMenu.isMenuShowing()) {
|
if (!mSlidingMenu.isMenuShowing()) {
|
||||||
Fragment category = getFragmentManager().findFragmentByTag(SettingsFragment.CATEGORY_TAG);
|
Fragment category = getFragmentManager().findFragmentByTag(SettingsFragment.CATEGORY_TAG);
|
||||||
if (category != null) {
|
if (category != null) {
|
||||||
getFragmentManager().beginTransaction().remove(category).commit();
|
getFragmentManager().beginTransaction()
|
||||||
|
.replace(R.id.content_frame, SettingsFragment.newInstance(R.xml.settings_main)).commit();
|
||||||
} else {
|
} else {
|
||||||
mSlidingMenu.showMenu();
|
mSlidingMenu.showMenu();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
|
|||||||
Fragment fragment = SettingsFragment.newInstance(resId);
|
Fragment fragment = SettingsFragment.newInstance(resId);
|
||||||
getFragmentManager()
|
getFragmentManager()
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
.add(R.id.content_frame, fragment, CATEGORY_TAG)
|
.replace(R.id.content_frame, fragment, CATEGORY_TAG)
|
||||||
.commit();
|
.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user