Android Question Close app completely..totally so it doesn't stay in the list of suspended apps

Acuario

Active Member
Licensed User
Longtime User
I have an app that I don't want to be resumed. When it is opened from the home screen it runs then closes itself. I want it to disappear from the list of suspended apps.
Activity.Finish ends the app but it stays in the list of suspended apps so can be resumed, Activity_Create is run with FirstTime=false. ExitApplication ends the app but leaves it in the suspended list as well (with a black screen), if it is activated then Activity_Create is run with FirstTime=true.
I only want the app to be re-started if the user opens it from the icon and not from the list of suspended apps.

Can this be done?

Why, you may ask.
My app, when it is opened, connects via mqtt and sends a message. I do not want this to be sent if the app is re-activated from the list of suspended apps, only if it is opened using the icon..
As Activity_Create gets run both on first run and on a re-activated app then it doesn't work in there as if the app is opened from the icon then FirstTime can be true or false, false if the app is re-started, the same as if it is re-started from the suspended apps list.
 
Last edited:

drgottjr

Expert
Licensed User
Longtime User
there are other ways to deal with figuring out where the app is (eg, statemanager). you should look into starter service and statemanager. the overlords are easily displeased.
 
Upvote 0
Top