Android异常篇 java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
Posted 彭老希
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android异常篇 java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState相关的知识,希望对你有一定的参考价值。
/**
* 显示实例
* @param activity 或者 Context
*/
public static void showInstance(FragmentActivity activity)
Bundle bundle = new Bundle();
XXXXXDialog dialog = new XXXXXDialog();
dialog .setArguments(bundle);
FragmentManager supportFragmentManager = activity.getSupportFragmentManager();
FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
fragmentTransaction.add(dialog ,"TagXXXX");
fragmentTransaction.commitAllowingStateLoss();
//show里面是commit() ---- 换成上面的 commitAllowingStateLoss 就行
//dialog .show(activity.getSupportFragmentManager(), "TagXXXX");
以上是关于Android异常篇 java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState的主要内容,如果未能解决你的问题,请参考以下文章
Tomcat 之战 - Spring Vaadin 应用程序
IllegalArgumentException: requirement failed: Corrupt index found