I was using the commit method in my project that built it with fragments.
Anyway, sometimes I was getting IllegalStateException: Can not perform this action after onSaveInstanceState
error and I couldn't find any good solution about it but just this method commitAllowingStateLoss()
. I changed commit function to commitAllowingStateLoss()
but didn't use it long time to test so may this function help me? And the main question, what is the difference between commit()
and commitAllowingStateLoss()
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…