Skip to content
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

Threads getting killed on back-button press #44

Open
jorgempy opened this issue Aug 29, 2018 · 1 comment
Open

Threads getting killed on back-button press #44

jorgempy opened this issue Aug 29, 2018 · 1 comment

Comments

@jorgempy
Copy link

Hi, Im using this thread lib on the react facebook example app.
When I press the back button from the main screen of my app the app goes to background (terminates kind-of). Thats the default behavior as far as i know.

The problem is, when this happens, the onHostDestroy method gets called. So the threads are terminated.
When I re-enter the app, nothing gets created, as the app is in a intermediate state, so the threads arent re-created. Instead a onHostResume gets called.

For now i have fixed this by changing the onHostDestroy method just to call onHostPause. But i dont know if this is a good long term solution.

Oneplus 6 Android 8.1.0

@Traviskn
Copy link
Contributor

Interesting! I probably haven't run into this bug yet because my app is pro-active about restarting threads that become unresponsive (my threads echo back every message they receive, and if they stop echoing for a long enough period of time I destroy and re-create them)

I'm also not sure if delegating an onHostDestroy call to an onHostPause method is the best long term solution. 🤔 Definitely open to hearing potential solutions for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants