-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Pressing the back button of Android in <Tabs/> minimized the application #2816
Comments
It's already fixed, using #2040 thanks to @hofuchi comment. |
@ndozhh I am not seeing this fixed? Using:
How do you exit app to Home screen without terminating the app? I think I have tried all #2040 combinations and app is terminated and must relaunch from scratch. Users may be in the middle of uploading or downloading and this kills the process. I expect the Android back button to minimize app and show home NOT terminate it.
When I try to resume, I see the splash screen so I know app is restarting from scratch. Anytime the app the back handler returns false the app is shut down and closed completyely.
|
A Java fix is the only one that that works for me. react-navigation/react-navigation#1372 (comment) Putting snippet below in your MainActivity will prevent back button from killing the activity. I'm not sure when you click the back button, on which screen, or what does exiting app mean. The snippet above prevents back button from executing the change or exiting the app if AppStack is the top router.
|
Version
Tell us which versions you are using:
Expected behaviour
In a Tabs component by pressing the Android back button on any Tab (except the first one), the focus returns to the first one (as in the TabBar page of the example).
Actual behaviour
By pressing the back button of Android in any Tab (except the first one), the application is minimized, use the onBack property in the second scene but it didn't work. I used,
onBack={ () => { }} (in previous versions it worked at least to prevent the app from closing)
and I used,
onBack={ () => {
Actions. pop();
}
and also
onBack={ () => {
Actions.popTo(sceneKey:"Accounts");
}
but no option works as expected.
Steps to reproduce
This is my code
The text was updated successfully, but these errors were encountered: