-
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
Refactors FormHierarchyActivity #1038
Conversation
18f3bb7
to
3c95cba
Compare
@lognaturel Please review |
3c95cba
to
f505df2
Compare
Replaces ListView click listener
f505df2
to
7ee7e7d
Compare
Heads up @shobhitagarwal1612, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
@shobhitagarwal1612 I must admit I'm not quite sure why this has been sitting for so long! I think between there being no description and the other form hierarchy pull request it got lost in the shuffle. Please fix the small merge conflicts and we can get this through a round of testing. |
@lognaturel Done |
@shobhitagarwal1612 Could you tell me what behaviors may have changed? |
|
|
@mmarciniak90 Yes, it was a mistake in my comment. Thank you for pointing it out 👍 |
Tested with success! |
@opendatakit-bot unlabel "needs testing" |
# Conflicts: # collect_app/src/main/java/org/odk/collect/android/activities/FormHierarchyActivity.java
@shobhitagarwal1612 the best things are worth the wait, right? 🙃 |
@lognaturel Well said 😄 |
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().
Fixes #740