Luminoth/BackpackPlanner

Fix IllegalStateException in android.support.v4.app.FragmentManagerImpl.checkStateLoss, line 1377

Closed this issue · 5 comments

Version: 1 | com.energonsoftware.BackpackPlanner.Droid

Reason

java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState

Link to HockeyApp

http://stackoverflow.com/questions/7575921/illegalstateexception-can-not-perform-this-action-after-onsaveinstancestate-h presents a possible solution to this.

If this crashes beyond it's current 8 times, then may need to investigate.

This seems to be related to pushing a new build to a real device while the app is running in the background

Ok, this actually seems to be tied to using async/await in OnCreate(). Doing that was allowing OnResume() to call earlier than it was supposed to. Remove the async/await resolved the issue.

Now the real kicker here is that simply Waiting() the call that was previously awaited hangs the app, so there seems to be a larger issue with the InitDatabaseAsync() call (perhaps a missing ConfigureAwait() somewhere?)

Indeed there was a missing ConfigureAwait(). This should be fixed now.