Use commitAllowingStateLoss instead of commit (#24)

This fixes a crash I saw in production on Android `java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState`. The fix is based on the comment here https://stackoverflow.com/questions/7575921/illegalstateexception-can-not-perform-this-action-after-onsaveinstancestate-wit.

The crash stopped happening since deploying this fix.

Fixes #20
This commit is contained in:
Janic Duplessis
2018-10-11 06:44:34 -04:00
committed by Krzysztof Magiera
parent 29022684cc
commit ece5b6ef6a

View File

@@ -96,7 +96,7 @@ public class ScreenContainer extends ViewGroup {
private void tryCommitTransaction() {
if (mCurrentTransaction != null) {
mCurrentTransaction.commit();
mCurrentTransaction.commitAllowingStateLoss();
mCurrentTransaction = null;
}
}