-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Crash when accessing jump menu #998
Comments
@lognaturel Theoretically it would be possible if user clicks on "Go to prompt" icon during form loading but it's not possible as the UI is blocked during form loading. FormController is set here so as I said above theoretically it would be possible but UI is blocked so we can't do that. I've also tried some strange scenarios with "Don't keep activities" option without success as well. The only one explanation is that someone is able to click on "Go to prompt" icon after dismissDialog but before https://github.com/opendatakit/collect/blob/master/collect_app/src/main/java/org/odk/collect/android/activities/FormEntryActivity.java#L2474 :)
Got it! It takes place when we close the app (when the FormHierarchyActivity is opened) using a physical button and leave the app for a long time (in my case it's at least 30 minutes), then if we open the app again the app crashes. I've added a small trick to solve that. |
Craaaaazy! Good find! I also thought it had to do with going to a prompt quickly and couldn't figure it out. I guess we see it happening frequently because users with less powerful phones may trigger that more quickly. |
The changes in #998 introduced a null check to make sure the FormHierarchyActivity is closed when FormController is null. #1038 created a subclass of FormHierarchyActivity -> ViewFormHierarchyActivity. This caused a reintroduction of the bug fixed in #998, as the subclass does not recheck for null in the onCreate() method. When the same situation that caused crash fixed in #998 occurs in the ViewFormHierarchyActivity following steps will happen: - ViewFormHierarchyActivity will start with calling super.onCreate() - A null check in super.onCreate() parent class FormHierarchyActivity::onCreate will call shortcut the onCreate() method by calling return, and call finish() on activity. - finish() will be scheduled to close the activity asynchronously after the onCreate() is finished - super.onCreate() is done, the rest of the onCreate() method in ViewFormHierarchyActivity will be called. The shortcut only affected stopping super.onCraete(), the onCreate() is still called. - Collect.getInstance().getFormController() will still be null. It needs to be to be shortcut again. No need to call finish() this time, as it was already called in the super.onCreate().
Stack trace from Firebase Crash. Happens across API levels.
The text was updated successfully, but these errors were encountered: