I am developing an Android library project which can be integrated to an app via a gradle dependency.
As a requirement I need to kill the app process from inside the library project.
I am using the following code to do that. But what I have noticed is that it kills the library project process but not the app process.
android.os.Process.killProcess(android.os.Process.myPid());
Any way or ways for achieving this?
EDIT: This has to be done at the library project level. Not from the client app level.
Create a Service class in main app.
and in your lib class use this.
This will solve your problem.