1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Avoid IllegalStateException

Reported for Kaiten:
java.lang.IllegalStateException: Can not perform this action after
onSaveInstanceState
...
at android.support.v4.app.DialogFragment.dismiss
This commit is contained in:
cketti 2013-04-02 02:30:07 +02:00
parent 9d7eae252e
commit 002e3dd538

View File

@ -768,6 +768,10 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
private void removeDialog(int dialogId) { private void removeDialog(int dialogId) {
FragmentManager fm = getFragmentManager(); FragmentManager fm = getFragmentManager();
if (isRemoving() || isDetached()) {
return;
}
// Make sure the "show dialog" transaction has been processed when we call // Make sure the "show dialog" transaction has been processed when we call
// findFragmentByTag() below. Otherwise the fragment won't be found and the dialog will // findFragmentByTag() below. Otherwise the fragment won't be found and the dialog will
// never be dismissed. // never be dismissed.