"Running" > [Select pro..." /> "Running" > [Select pro..." /> "Running" > [Select pro..."/>

Stop the process on Android using Ruboto

104 Views Asked by At

Is it possible to Stop the process on Android using the script running in Ruboto's IRB, i.e. automate: "Application manager" > "Running" > [Select process] > Press "Stop"?

1

There are 1 best solutions below

0
On

A process can stop itself by executing

java.lang.System.runFinalizersOnExit(true)
java.lang.System.exit(0)

You can stop another process with

Process.KillProcess(int pid)

http://developer.android.com/reference/android/os/Process.html#killProcess%28int%29

You will need the KILL_BACKGROUND_PROCESSES permission:

http://developer.android.com/reference/android/Manifest.permission.html#KILL_BACKGROUND_PROCESSES