Move all fragment work to UI thread #356
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Our app crashed with the following call stack:
It would appear to be caused by this code running at the same time the UI thread is manipulating the map of fragments. Given that the code that adds/updates fragments must run on the UI thread, it would seem that code that queries for fragments also needs to use the UI thread.
Test Plan
Used the updated code in our app and made sure the time picker dialog functions properly.
What's required for testing (prerequisites)?
An Android app that shows the date and time pickers.
What are the steps to reproduce (after prerequisites)?
I was not able to reproduce it given that it involves two threads manipulating fragments at the same time.
Compatibility
Checklist
README.md
example/App.js
)