My goal is to kill a (background) process from a native function called from the java code in my application. What I've got so far is a native function with this code:
popen("am kill com.example.application", "r");
it doesn't do anything, and if I try to get the output with the pipe the application crashes. I've also set the KILL_BACKGROUND_PROCESS permission in the manifest.
What could be the problem?