-
Notifications
You must be signed in to change notification settings - Fork 275
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
[Bug] Exit the App with Android "back" Button #1146
Comments
Back must be pressed within 3s, otherwise there is a new toast. |
Exiting the app with triggering the back button multiple times within 3 seconds doesn't work for me. In general the back button works in other parts of the app |
I have the same problem with my Pixel 6 running Android 14. From Android 13 the |
That seem to explain it. |
I have made some tests and using androidx.activity.OnBackPressedCallback (and OnBackInvokedCallback in SettingsActivity) seems to fix the issue. I can make a PR I you want to have a look/try. |
yes please |
Unfortunately, using OnBackPressedCallback/OnBackInvokedCallback did not solve the issue after all. During my tests, I had enabled the Predictive back animations feature on my device (Settings > System > Developer options). When this setting is disabled, the problem is still there. A quick and simple fix, perhaps, would be to replace super.onBackPressed(); // finish activity with finish(); // finish activity in SettingsActivity.onBackPressed() (line 416)? The root cause seems to be TabActivity that MainLayout extends. If StartActivity is declared as the main activity (in Manifest.xml) instead of MainLayout, exiting from StartActivity works as intended. I think the "correct" fix would be to replace TabActivity with AppCompatActivity as suggested in #648. |
Thanks for the info. It often is more difficult then it seems.
Yes, that requires rewriting the activities to fragments so not trivial (maybe for settings too, that should be easier though). |
This seems to be handled in #1176 |
It doesn't work for me either in my app autovolume. I noticed it on Android 14. I have a foreground service. It works on older version. I opened a bug for Google. |
Having the App open and pressing the Android back Button/functionality doesn't work on my Android 13 decice.
A toast message appears "Press Back again to exit" pressing the Back-Button one time..
After that only this toast message appears again and again continuing to press back.
Device: Google Pixel
Android Version: 13
The text was updated successfully, but these errors were encountered: