Fix bug
Can not perform this action after onSaveInstanceState com.mogo.module.small.map.SmallMapProvider.showPanel(SmallMapProvider.java:68)
This commit is contained in:
@@ -65,22 +65,30 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang
|
||||
@Override
|
||||
public void showPanel() {
|
||||
Log.d(TAG, "小地图模块触发展示……");
|
||||
if (mSmallMapFragment == null) {
|
||||
Logger.d(TAG, "准备add fragment======");
|
||||
mSmallMapFragment = new SmallMapFragment();
|
||||
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, mSmallMapFragment).commit();
|
||||
return;
|
||||
try {
|
||||
if (mSmallMapFragment == null) {
|
||||
Logger.d(TAG, "准备add fragment======");
|
||||
mSmallMapFragment = new SmallMapFragment();
|
||||
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, mSmallMapFragment).commit();
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "准备show fragment");
|
||||
mActivity.getSupportFragmentManager().beginTransaction().show(mSmallMapFragment).commit();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Logger.d(TAG, "准备show fragment");
|
||||
mActivity.getSupportFragmentManager().beginTransaction().show(mSmallMapFragment).commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hidePanel() {
|
||||
Log.d(TAG, "小地图模块触发隐藏……");
|
||||
if (mSmallMapFragment != null) {
|
||||
Logger.d(TAG, "准备hide fragment");
|
||||
mActivity.getSupportFragmentManager().beginTransaction().hide(mSmallMapFragment).commit();
|
||||
try {
|
||||
if (mSmallMapFragment != null) {
|
||||
Logger.d(TAG, "准备hide fragment");
|
||||
mActivity.getSupportFragmentManager().beginTransaction().hide(mSmallMapFragment).commit();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user