SMOOTSARA Active Member Licensed User Longtime User Jun 27, 2021 #1 Hi guys ? how to handle Activity_KeyPress for ExitApplication? I go from the "main page" to the "second page" and from there to the "third page" Click the back button on the "third page" and then return to the ""second page" and click again and return "main page" Now if I am on the "main page" if click again I have to exit the program B4X: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean ExitApplication !!!!!!!! Return B4XPages.Delegate.Activity_KeyPress(KeyCode) End Sub
Hi guys ? how to handle Activity_KeyPress for ExitApplication? I go from the "main page" to the "second page" and from there to the "third page" Click the back button on the "third page" and then return to the ""second page" and click again and return "main page" Now if I am on the "main page" if click again I have to exit the program B4X: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean ExitApplication !!!!!!!! Return B4XPages.Delegate.Activity_KeyPress(KeyCode) End Sub
Erel B4X founder Staff member Licensed User Longtime User Jun 27, 2021 #2 You don't need to do anything special. If the user clicks on the back key when there are no pages in the stack then the app moves to the background. This is the expected behavior. Upvote 0
You don't need to do anything special. If the user clicks on the back key when there are no pages in the stack then the app moves to the background. This is the expected behavior.
SMOOTSARA Active Member Licensed User Longtime User Jun 27, 2021 #3 Erel said: You don't need to do anything special. If the user clicks on the back key when there are no pages in the stack then the app moves to the background. This is the expected behavior. Click to expand... I'm going to close the program completely I do not want the app to be open in the background Upvote 0
Erel said: You don't need to do anything special. If the user clicks on the back key when there are no pages in the stack then the app moves to the background. This is the expected behavior. Click to expand... I'm going to close the program completely I do not want the app to be open in the background
Erel B4X founder Staff member Licensed User Longtime User Jun 27, 2021 #4 This is a mistake in 99% of the cases. You should let the OS handle the process life cycle. No need to worry about it. If you want to make your app less reliable then handle the B4XPage_CloseRequest and call ExitApplication there. Upvote 0
This is a mistake in 99% of the cases. You should let the OS handle the process life cycle. No need to worry about it. If you want to make your app less reliable then handle the B4XPage_CloseRequest and call ExitApplication there.
SMOOTSARA Active Member Licensed User Longtime User Jun 27, 2021 #5 Erel said: This is a mistake in 99% of the cases. You should let the OS handle the process life cycle. No need to worry about it. If you want to make your app less reliable then handle the B4XPage_CloseRequest and call ExitApplication there. Click to expand... " If you want to make your app less reliable then handle the B4XPage_CloseRequest and call ExitApplication there." If possible for you? Please guide me with a few lines of code ? Upvote 0
Erel said: This is a mistake in 99% of the cases. You should let the OS handle the process life cycle. No need to worry about it. If you want to make your app less reliable then handle the B4XPage_CloseRequest and call ExitApplication there. Click to expand... " If you want to make your app less reliable then handle the B4XPage_CloseRequest and call ExitApplication there." If possible for you? Please guide me with a few lines of code ?
TILogistic Expert Licensed User Longtime User Jun 27, 2021 #6 B4XMainPage B4X: Copy Private Sub B4XPage_CloseRequest As ResumableSub ExitApplication Return True End Sub Upvote 0
B4XMainPage B4X: Copy Private Sub B4XPage_CloseRequest As ResumableSub ExitApplication Return True End Sub