Android Question Stop a running application

mmanso

Active Member
Licensed User
Longtime User
Hi there,

With B4A can I stop an application that's running? I need to restart (stop first and start it) an application that's running on my phone.

Thanks.
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
You have several options depending how you want it to be :
- if only closing an Activity : Activity.Finish
- if closing ALL the whole app, be sure to previously stop any service, timer, background task and than ExitApplication (if you don't stop anything, the System would produce some errors). Use it with caution
- Stopping a service is done using StopService(ServiceName)

Generally speaking, depending on your Workflow, it is possible to simulate any restart without having to stop anything. In case it could be help

Edit: it works only for Your application, of course.
 
Upvote 0

ronell

Well-Known Member
Licensed User
Longtime User
Hi there,

With B4A can I stop an application that's running? I need to restart (stop first and start it) an application that's running on my phone.

Thanks.
provide more information about your app.. be specific and you will get an specific answer
 
Upvote 0

mmanso

Active Member
Licensed User
Longtime User
Hi there,

I'm not trying to kill my app... I'm trying to understand if I can write an app with B4A that kills (or stops) an app that's running on the device and start it up again.

Thanks a lot for the help.
 
Upvote 0
Top