-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug #192: crash when home button pressed during quick add task sa… #255
Fix bug #192: crash when home button pressed during quick add task sa… #255
Conversation
…ved message displayed to user. (Solution from http://stackoverflow.com/a/21701607/4247460)
Sorry, that doesn't look like a solution, but more like a hack. |
Yes, I debugged it and it happens when QuickAddDialogFragment is dismissed automatically with delay after the 'Saved' notification was shown to user, and when in the meantime the app was put to background (home button pressed), so the activity had stopped. (Using dismissAllowingStateLoss() (which uses FragmentTransaction.commitAllowingStateLoss()) for this case is suggested here as well: At first I thought the possible state loss with commitAllowingStateLoss() is only about the state of the fragment, which would be okay for a removed fragment, because it won’t be restored anyway. But I see in the docs now that it might loose the actual commit itself as well.. |
After looking into this more, I think this bug may tell that a different approach might be needed for this delayed dialog updates: I see the following options now:
|
…"SAVE" when app is moved to background.
In the last commit I used Option 2., so dismiss() in onPause() if the delayed dismiss has been scheduled already. According to the post there is still a chance in pre-Honeycomb to loose state but it won't throw exception. |
@dmfs Please review. |
Looks good. Merged into staging. |
…ved message displayed to user. (Solution from http://stackoverflow.com/a/21701607/4247460)