Android Question B4A activity life cycle/behaviour question

Unobtainius

Active Member
Licensed User
Longtime User
I have a tablet that sits in a dock
In general the dock just supplies power to the tablet
When the tablet is removed from that dock my B4XPages application seems to be killed and restarts as if for the first time
This does not happen when connected to a normal power supply and plugging it in and unplugging it
Has anyone else come across this behaviour?
I cant see a solution to this other than continuously storing the application state and checking that on initialisation of the main activity, then restoring all gathered variables and flicking through screens to put the user back to where they were when they undocked the tablet.
Any suggestions or requests for further information appreciated
 

TILogistic

Expert
Licensed User
Longtime User
Some time ago something similar happened to me, the solution was to check the configuration of the tablet so that the energy saving is not activated and eliminate the APP process.

And I think it eliminates some processes that are doing on energy consumption, as in mobile phones.
 
Upvote 0

Unobtainius

Active Member
Licensed User
Longtime User
Thanks @oparra that's an avenue I will pursue.
 
Upvote 0

Unobtainius

Active Member
Licensed User
Longtime User
Add this to the manifest editor:
B4X:
SetActivityAttribute(Main, android:configChanges, "uiMode")
Worked like a charm, thanks everyone
 
Upvote 0
Top