Fixed GlobalConfigFragment crash
This commit is contained in:
parent
06ea0749fa
commit
d2d7e9a726
@ -127,6 +127,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||
|
||||
Log.d(TAG, "onDestroy");
|
||||
instance = null;
|
||||
currentFragment = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user