Alexander Stolte Expert Licensed User Longtime User Jun 14, 2020 #1 Hey, it would be nice to be able to check if it is the last page, for example to show the user a message box (tap again to exit the app).
Hey, it would be nice to be able to check if it is the last page, for example to show the user a message box (tap again to exit the app).
Erel B4X founder Staff member Licensed User Longtime User Jun 15, 2020 #2 If you want to show it when the user tries to close the page: https://www.b4x.com/android/forum/t...or-managing-multiple-pages.118901/post-743793 The CloseRequest will only be raised when the page is on the top. Checking if the current page is the top page: B4X: If B4XPages.GetManager.GetTopPage.B4XPage = Me Then End If Upvote 0
If you want to show it when the user tries to close the page: https://www.b4x.com/android/forum/t...or-managing-multiple-pages.118901/post-743793 The CloseRequest will only be raised when the page is on the top. Checking if the current page is the top page: B4X: If B4XPages.GetManager.GetTopPage.B4XPage = Me Then End If
Alexander Stolte Expert Licensed User Longtime User Jun 15, 2020 #3 Erel said: Checking if the current page is the top page: Click to expand... and if I want to check if the app closes when I press the back button because I am on the last page? Upvote 0
Erel said: Checking if the current page is the top page: Click to expand... and if I want to check if the app closes when I press the back button because I am on the last page?
Erel B4X founder Staff member Licensed User Longtime User Jun 15, 2020 #4 Now I understand. 1. The app will not be closed. It will only move to the background. Same as clicking on the home button. 2. Checking if there is only one page on the stack: B4X: If B4XPages.GetManager.mStackOfPageIds.Size = 1 Then ... End If Upvote 0
Now I understand. 1. The app will not be closed. It will only move to the background. Same as clicking on the home button. 2. Checking if there is only one page on the stack: B4X: If B4XPages.GetManager.mStackOfPageIds.Size = 1 Then ... End If