Digging this BackHandler problem long long time, I found default expo app has the same problem.
See the videos first.
Initial Launch(or restart app after manually kill the app using task manager)
https://youtu.be/espHwOxplvk
→ back button works well by moving to previous tab navigation.
Restart after android kill the app due to resource lack
https://youtu.be/H9hxjkNXslo
→ back button always sends the app to the background.
I found some articles or topics refer to firebase as a reason, but it isn’t(default project doesn’t use firebase at all).
Some more test detail:
- I tried to add event handler manually by ‘BackHandler.addEventListner’ after restart. but when I press back button, the event handlers are all skipped(I never removed the handler).
- I have tested on real devices such as Galaxy S9, Galaxy S4, and Mi5.
→ I concluded this is not a specific code/device issue, but Expo or React Navigation Issue.(if anyone has used React Navigation without Expo, please let me know!)
Does anyone know how to solve this problem?