0

Help me! I need the source code to force stop an Android application programmatically. I already tried

Process.killProcess(int pid))

but it didn't work

Thank You.

Binara Medawatta
  • 512
  • 1
  • 9
  • 28
pamitha
  • 55
  • 1
  • 5

1 Answers1

1

Three ways to stop a process from java

1.kill directly

Process.killProcess(Process.myPid());

2.send SIG_KILL

Process.sendSignal(Process.myPid(), Process.SIGNAL_KILL);

3.the unfriendly way, terminate the vm

System.exit(0);
alijandro
  • 11,627
  • 2
  • 58
  • 74