In a B4XPages project, I am stepping through a sequence of six pages forward and back.
I am not using the title bar or built-in navigation. I use buttons to move forward and back through the sequence. There are valid UI reasons for doing this.
I am developing in B4A and will add B4i later.
My problem is related to the page stack. With the "forward" button, I have been using B4XPages.ShowPage(<next page>) and with the back button I have been using B4XPages.ShowPageAndRemovePreviousPages(<previous page>).
This always works even though the standard B4XPages logging seems to show that the stack has been removed. The problem is that the phone's back button seems to lose track of the stack and when pressed *sometimes* it closes the app and returns the user to the phone home screen. Just sometimes (and I'm not sure why).
I can't use ShowPage() to go back because it adds to the stack.
Even though it works, I can't use ClosePage() because I'll be adding a B4i version in the near future and the documentation says in B4i it only works on the top page.
So, how should I programmatically move back through a sequence of pages in a manner that respects the stack, works on all platforms, and is compatible with the phone's back button so that it can be used for the same purpose?
Many thanks for any assistance.
I am not using the title bar or built-in navigation. I use buttons to move forward and back through the sequence. There are valid UI reasons for doing this.
I am developing in B4A and will add B4i later.
My problem is related to the page stack. With the "forward" button, I have been using B4XPages.ShowPage(<next page>) and with the back button I have been using B4XPages.ShowPageAndRemovePreviousPages(<previous page>).
This always works even though the standard B4XPages logging seems to show that the stack has been removed. The problem is that the phone's back button seems to lose track of the stack and when pressed *sometimes* it closes the app and returns the user to the phone home screen. Just sometimes (and I'm not sure why).
I can't use ShowPage() to go back because it adds to the stack.
Even though it works, I can't use ClosePage() because I'll be adding a B4i version in the near future and the documentation says in B4i it only works on the top page.
So, how should I programmatically move back through a sequence of pages in a manner that respects the stack, works on all platforms, and is compatible with the phone's back button so that it can be used for the same purpose?
Many thanks for any assistance.