sometimes, i will get a
java.lang.IllegalStateException Can not perform this action after onSaveInstanceState
when i try to show a DialogFragment
.
so now the question is how i can write a if statement to judge current state before i involve the show method like this?
if(!isAfterOnSaveInstanceState())
dialog.show(getSupportFragment(),"MY DIALOG");
because i notice that the DialogFragment
own the method dismissAllowingStateLoss()
but lack of a method to allow state loss when show, maybe the design of the DialogFragent
want developers to judge before call show
method.
Thanks in advance.