[Video Included] BackHandler is not working after android killed the app -> restart

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?

Hey @publy,

I would recommend creating an issue on the react-navigation repo as this sounds like it’s pertaining to that library, rather than Expo. Just be sure to thoroughly fill out the issue template there!

Cheers,

Adam

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.