In my android application, I create a child process with Runtime.getRuntime().exec().
But may be a situation, where a user kills my application, but the child process is still running. What I want is, when I kill the application, also kill the child process. How I can do it?
I would
Runtime.getRuntime().addShutdownHook() that would be called when the application is shutdown and kill all the processes spawned, that were tracked in previous step.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With