Hi, Guys
I have come across a question regarding restarting an App – in B4Xpages – which relates in both B4a and B4i.
In my App there is a settings page which allows the user to select what controls are shown on each page. In most cases these pages are setup during their “pagename_Create()” event (which maybe my first mistake).
This works great, until the user decides to change the settings. If these settings change UI pages then problems occur when the pages are re displayed. It this was Windows, I would resort to “Major changes - the Program needs to restart” tactic and simply close the program and restart it automatically.
Unless I have misunderstood something, it is not considered good practice to shut down an App in Android or iOS (not even sure it can be done in B4i) and restart it (there are some old posts which do show how to do it).
As I see it, the pages need to be somehow destroyed so when re-shown the pagename_Created() event runs.
Maybe I am missing something, but it looks to me that I must move most of the code in the _Create() to the _Appear() event to ensure that the page displays the correct views. As you can appreciate this does increase the overheads every time a page is displayed.
Any suggestions or input?
Kind regards
Dave
I have come across a question regarding restarting an App – in B4Xpages – which relates in both B4a and B4i.
In my App there is a settings page which allows the user to select what controls are shown on each page. In most cases these pages are setup during their “pagename_Create()” event (which maybe my first mistake).
This works great, until the user decides to change the settings. If these settings change UI pages then problems occur when the pages are re displayed. It this was Windows, I would resort to “Major changes - the Program needs to restart” tactic and simply close the program and restart it automatically.
Unless I have misunderstood something, it is not considered good practice to shut down an App in Android or iOS (not even sure it can be done in B4i) and restart it (there are some old posts which do show how to do it).
As I see it, the pages need to be somehow destroyed so when re-shown the pagename_Created() event runs.
Maybe I am missing something, but it looks to me that I must move most of the code in the _Create() to the _Appear() event to ensure that the page displays the correct views. As you can appreciate this does increase the overheads every time a page is displayed.
Any suggestions or input?
Kind regards
Dave
Last edited: