DialogFragment调用show()报Can not perform this action after onSaveInstanceState的解决办法
参考文章:
- 使用自定义DialogFragment出现IllegalStateException: Can not perform this action after onSaveInstanceState异常
- Fragment Or DialogFragment Can not perform this action after onSaveInstanceState
解决办法:
- 在BaseDialog中重写show()和dismiss()方法。
@Override
public void show(FragmentManager manager, String tag) {
// super.show(manager, tag);
try {
Class c = Class.forName("android.support.v4.app.DialogFragment");
Constructor con = c.getConstructor();
Object obj = con.newInstance();