iOS Question Get name of current page on Resume (Application_Active)

Mike1970

Well-Known Member
Licensed User
Hi everyone, i was trying to replicate the Activity_Resume of B4A in iOS.
There is the Application_Active, but the problem is that i need to do page related things.

Example
User opens the app on Page 0, then he go to Page1, then the user sends the app to background.
Then he resume the app, so the app will show Page1 that was displayed before, Application_Active is triggered.
BUT Application_Active (the same sub) is triggered also when the displayed page is Page2 or Page3 or Page4, and maybe in this case i don't need the code in Application_Active:

So, given the fact that Page oject does not have any _Resume event, my idea was to do something like:

B4X:
Private Sub Application_Active
  Select NavControl.currentPage 'this method does not exists'
    Case Page0
      ...
    Case Page1
      ...
  End Select
End Sub

there is a "native" way to retrive the current page? or I simply just need to store myself a variable and keep it updated everytime i switch page?

Thanks in advance :)
 

Star-Dust

Expert
Licensed User
try this
 
Upvote 0

Mike1970

Well-Known Member
Licensed User
try this
Oh ok thanks. I tought there was a native way.
In this cases I think I will post a code snippet, a think I found an “”elegant”” way to do it
 
Upvote 0

Star-Dust

Expert
Licensed User
Oh ok thanks. I tought there was a native way.
In this cases I think I will post a code snippet, a think I found an “”elegant”” way to do it
As I remember there is no way in b4i, but I could be wrong.
 
Upvote 0

Mike1970

Well-Known Member
Licensed User
You are really wasting your time. Switch to B4XPages. You will be able to share all the code and everything will be simple
It is in my ToDo list, i'm waiting to have enough time between different works to study it.
And the thing that stops me to do it now is the fact that i often use specific things, that in android and iOS are completely different, so i have to do it separately in any case.. (example: qrcode reader, in android i've to use some type of libraries, not all works fine in all situations.. in iOS in integrated in the system and it's easier to use) so at the moment, I saw b4xpages as an interesting thing, but maybe not suitable for 100% of the cases
 
Last edited:
Upvote 0
Top