Android Question Activity issues

kepler

Active Member
Licensed User
Longtime User
Hi,

My app runs a first activity. With a call, I hide the main panel and load a second. Meanwhile, I got a service module running. Problem: when the cell phome hibernates, the resume routine is called, right? So...the second panel wouldn't appear - only the main. So, I placed a global variable for the second panel (true or false).

So when the resume is called, if the variable is True, I make the second panel visible as true, and the main visible set to false.

Even so, after the hibernation neither the panels appear - f the hibernation is too long...If it's relatively short, the second is there - as suposed to.

Must I create a second activity instead of loading/unloading panels?

I apreciate all the possible feedback.

Kind regards,

Kepler
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
I do not think I understand .
Do you want your panel to get loaded when phone receives a call ?
Do you use intent filter to start your service with call taking place ?
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Hi,
Must I create a second activity instead of loading/unloading panels?
In my opinion, if other panels do not act as, say "pop-ups", yes, you could or perhaps should move them to another activity. It depends on what you're trying to achieve, but usually creating activities instead of panels over panels is better.
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi,

Indeed you're right. Still, with this app, which runs for a very long time (it' for professional drivers) if the phone gets to "sleep" I had the problem of returning to the main screen in the resume. Only the services modules were running. I had to create a global variable set to true or false to know exactly wich panel to display...

Weird...but solved - at least for now.

Thanks,

Kepler
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Basic activity life-cycle issue... Any activity, being it a B4x created app or any other, when in background for long risk being terminated by the OS and the ap will start fresh when brought to foreground.
A way to managed and minimise this standard behaviour is to use the StarterService to manage the app re-entry point.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…