diff --git a/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java b/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java index eafb137..2b55164 100644 --- a/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java +++ b/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java @@ -127,6 +127,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On Log.d(TAG, "onDestroy"); instance = null; + currentFragment = null; } @Override diff --git a/app/src/main/java/org/itxtech/daedalus/fragment/SettingsFragment.java b/app/src/main/java/org/itxtech/daedalus/fragment/SettingsFragment.java index 13d0aa1..41e1620 100644 --- a/app/src/main/java/org/itxtech/daedalus/fragment/SettingsFragment.java +++ b/app/src/main/java/org/itxtech/daedalus/fragment/SettingsFragment.java @@ -1,6 +1,7 @@ package org.itxtech.daedalus.fragment; import android.app.FragmentManager; +import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -27,7 +28,12 @@ public class SettingsFragment extends ToolbarFragment { @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - FragmentManager fm = getFragmentManager(); + FragmentManager fm; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + fm = getChildFragmentManager(); + } else { + fm = getFragmentManager(); + } fm.beginTransaction().replace(R.id.settings_content, new GlobalConfigFragment()).commit(); }