I am using the RootTools library to execute some shell commands on my android App.
However I need to wait for the commands to finish before proceeding. The documentation shows a waitForFinish()
method which is not available on the latest version of the library at least.
How would I accomplish a similar behaviour?
This work for me:
First you must instace the command without enabling the handler
(with false):
Command command = new Command(0, false, "cat")
Next do something like this:
RootTools.getShell(true).add(command);
while (!command.isFinished())
{
try
{
Thread.sleep(50);
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
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