Hi, I need to run something whenever the program starts.
In the "Created" it runs the first time, if I close the program and reopen it, it doesn't run.
In the "Appair" it is not valid because it is executed when the page changes and returns to the first one.
Where do I put it?
It is to ask for a password, show a splash, etc.
In B4XMainPage I can't find the solution.
Do I put the code in the "Activiy Main"?
Thank you.
It also doesn't work in Initialize :/
The first time it does run showsplash and other things.
Then I close, I open ... and it doesn't go through Initialize.
I have put "logs" to follow it and you can see that it does not go through Initialize.
It is exactly the same case.
When you start the application you must ask for a password (among other things).
If I exit the application and enter again, it does not go through "Create", so it does not ask for the password.
I think Erel is not right in what he says in that other thread (now I will get hits from all sides )
In the activities the "Create" is always executed when you start the application, if you exit the application and re-enter then it runs again create (although in that case is not "firstime").
However, with B4Xpages this does not happen, there is no other solution than to use a variable, as discussed in this other thread.
That's the conclusion I've reached after many tests.
Hopefully there is a more appropriate solution.
Thank you.
But that's the problem, isn't it?
That "Created" is not executed after leaving the application and entering again, so that other page would not be shown either.
Why do you need to login (and show the splash screen) twice?
If the user forces the app to close, or the operating system kills it or when the user turns off the device and turns it back on the next day, the splash screen and login will be displayed.