Android Question totally kill activity

Stern0m1

Member
Licensed User
Is there anyway in b4a to totally kill an activity.
Activity.finish still leaves some remnants.

adding to manifest file for the activity noHistory="true" I think gives me the equivalent.

I know Erel in general doesn't like killing the entire app with ExitApplication, Why?

thanks
 
Last edited:

KMatle

Expert
Licensed User
Longtime User
A phone is not like a regular pc.

My phone runs now for 1 1/2 years without shutting it down (except the 2-3 updates which did a restart). I shut down my pc/laptop after every use. Maybe 2-3 times a day.

So on a device which is running non-stop for month's the apps are designed the same. Long and lasting. Like WhatsApp you use it several times a day. Like your phone app which is needed to work 24/7 to receive calls.

Imagine now on this stable system someone wants to kill an app totally. It's not ment to be and maybe it leaves the whole system unstable (think about very complex apps with 20 services and 50 activities). Bad idea to kill everything.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
When you call ExitApplication the OS thinks that the process has crashed. It may try to restart it or to start the last service. Except for very few cases it will not do anything good.

You should let the OS handle the process life cycle like it does with all other applications and not worry about the remains of any Activity. There are none.
 
Upvote 0
Top