How can I stop new Thread(new Runnable()).run
I am new in android development :D, and I need your help :)
I have this code and I would like to stop it after executing
new Thread(new Runnable() {
@Override public void run() {
Log.e("MotionLogger", "SU");
Log.i(TAG, "click " + Thread.currentThread().toString());
try {
finalCommandLine.writeBytes(command.toString() + '\n');
finalCommandLine.writeBytes("exit\n");
finalCommandLine.flush();
finalCommandLine.close();
finalSuShell.waitFor();
} catch (IOException e1) {
e1.printStackTrace();
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
}).start();
Thanks in advance :)