B4A Question Back key in running Service - DonManfred (first post)    May 05, 2021   (1 reaction) You only can react in an activity when the activity goes to the background.
You can not intercept the backkey or home key. B4A Question How to handle Activity_Keypress with animation - Erel (first post)    Sep 10, 2020   (1 reaction) Only now I understand why you wrote Activity_KeyPress. You should say "back key".
The back key is handled in B4XPage_CloseRequest: https://www.b4x.com/android/forum/threads/b4x-b4xpages-cross-platform-and-simple-framework-for-managing-multiple-pages.118901/post-744867 B4A Question [B4XPages] Question about user closing from task manager. - vfafou (first post)    Oct 05, 2020 Oh, yes! You are right!
Back key is the UserClosed = True.
The real question is how to detect the closing from task manager within B4XPages!!! B4A Library [B4X] B4XPreferencesDialog - Cross platform forms - Erel    Nov 12, 2021   (51 reactions) 'Handle the back key (see the example project for B4XPages implementation) Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then If prefdialog.BackKeyPressed Then Return True End If Return False End Sub 'Handle ke B4A Question B4XPages, press back key when in edittext with Auto-fill showing - drgottjr (first post)    May 02, 2024 we're talking about the same key. when the keyboard is down, the "back" key points "back". when the keyboard is up, the "back" key points "down". some key, different function (depending on whether it's pointing back or down). you got 2 "back" keys? just askin', but why would somebody have 2 bac B4A Question Back key and home key on the device - Erel (first post)    Sep 22, 2020   (1 reaction) Tip: switch to B4XPages and everything will be simpler.
In non-B4XPages the back button destroys the current activity and the home button pauses the activity and shows the home screen.
In B4XPages the back button hides the current page. Pages are never paused or destroyed. The home button moves the B4A Question Cancelling ProgressDialogShow2 - ilan (first post)    Jul 18, 2023   (2 reactions) You need to handle the back key in the _KeyPress Event
Sub Activity_KeyPress (KeyCode As Int) As Boolean
...
End Sub
there you check the KeyCode and return true to not close the activity and also put the dialog hide command something like this
Sub Activity_KeyPress (KeyCode As Int) As Boolean
B4A Question B4xPage back key is unnormal in TVset. - Erel (first post)    Mar 22, 2022 It takes to the home screen when the current page is the only page in the pages stack. B4A Question Avoid the app to exit when swiped from right to left - Erel (first post)    Nov 30, 2022 The back key raises this event. This is the way to intercept it.
It is unlikely to work but see whether the B4XPage_CloseRequest event is raised when you swipe. B4A Tutorial Introduction to the libGDX library - Informatix (first post)    May 23, 2016   (2 reactions) It is dangerous to handle the Back Key with the Activity_KeyPress event in a libGdx game because all events are supposed to be seen and processed by the libGDX engine. You can have unexplained crashes when leaving a screen or an app by doing that as libGDX was not able to perform some internal opera Page: 1   2   3   4   5   6   7   Powered by ColBERT |