Check an app is running

pr3jker

Member
I have a Network Monitor app which occasionally gets closed (still trying to know why).
Meanwhile, I think I could use a macro just to check it's running and relaunch it if not.
I just need some help with the code. Please.
 

Jacob L

Moderator (Lawsonator)
Firstly follow steps at dontkillmyapp.com for your app.

Then the only way to check your app is running is to check if it is in foreground. There's a trigger for application open/closed and magic text for foreground app package or app name. You just compare it to the name of the network monitor app.
 

pr3jker

Member
Firstly follow steps at dontkillmyapp.com for your app.

Then the only way to check your app is running is to check if it is in foreground. There's a trigger for application open/closed and magic text for foreground app package or app name. You just compare it to the name of the network monitor app.
My coding skills are not enough for this. I'd rather cancel any macro on this
 

MacroDroidDev

Administrator
Staff member
I'm afraid it's not possible to detect if an app is alive in the background (It used to be but Google now blocks that). As suggested by Jacob please look into dontkillmyapp.com as this will account for most issues where an app gets killed off unwantedly.
 
Top