I think you can use activity.fininsh. maybe use it in the activity_keypress event. check for keycode=keycodes.keycode_back? Return true. That's what I use and it seems to work. Maybe try it in the Pause event?
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
Select Case KeyCode
Case KeyCodes.KEYCODE_BACK
'sould we confirm action??
Activity.Finish
Return True
End Select
End Sub
I think you can use activity.fininsh. maybe use it in the activity_keypress event. check for keycode=keycodes.keycode_back? Return true. That's what I use and it seems to work. Maybe try it in the Pause event?
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
Select Case KeyCode
Case KeyCodes.KEYCODE_BACK
'sould we confirm action??
Activity.Finish
Return True
End Select
End Sub
I think you can use activity.fininsh. maybe use it in the activity_keypress event. check for keycode=keycodes.keycode_back? Return true. That's what I use and it seems to work. Maybe try it in the Pause event?
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
Select Case KeyCode
Case KeyCodes.KEYCODE_BACK
'sould we confirm action??
Activity.Finish
Return True
End Select
End Sub
Most applications should not use ExitApplication but prefer Activity.Finish which lets the OS
decide when the process is killed.
You should use it only if you really need to fully kill the process.
Calling ExitApplication will immediately kill the process. If you have a running process then Android will try to rerun your app (as if it has crashed). Monitor the unfiltered logs.
Calling ExitApplication will immediately kill the process. If you have a running process then Android will try to rerun your app (as if it has crashed). Monitor the unfiltered logs.