I am creating a locker application, in which I want to close my application when user presses power button to lock screen or when screen off after timeout. I have tried to do this using onResume(), onPause() function but nothings works perfect.
Asked
Active
Viewed 46 times
1 Answers
-1
you can do it by kill the current process by
android.os.Process.killProcess(android.os.Process.myPid());

Vikas Soni
- 11
- 4