Fix crash in finish from onCreate.
Change-Id: Ia4937fecdc93e30a468b8fefd2f8776186c8e151 Fixes: 29245324
This commit is contained in:
@@ -690,7 +690,10 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
|
|||||||
|
|
||||||
public void finish() {
|
public void finish() {
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if (activity != null && !activity.getFragmentManager().popBackStackImmediate()) {
|
if (activity == null) return;
|
||||||
|
if (getFragmentManager().getBackStackEntryCount() > 0) {
|
||||||
|
getFragmentManager().popBackStack();
|
||||||
|
} else {
|
||||||
activity.finish();
|
activity.finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user