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");
|
Log.d(TAG, "onDestroy");
|
||||||
instance = null;
|
instance = null;
|
||||||
|
currentFragment = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.itxtech.daedalus.fragment;
|
package org.itxtech.daedalus.fragment;
|
||||||
|
|
||||||
import android.app.FragmentManager;
|
import android.app.FragmentManager;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -27,7 +28,12 @@ public class SettingsFragment extends ToolbarFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, 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();
|
fm.beginTransaction().replace(R.id.settings_content, new GlobalConfigFragment()).commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user