While creating an app I have run into the issue of closing a thread that runs user inputted code using Beanshell. thread.stop(); failed to kill the thread any ideas? Running the code a line at a time isn't plausible due to loops in the users code.
final Thread thread = new Thread() {
public void run() {
try {
interpreter.run();
} catch (RuntimeException runEx) {
runEx.printStackTrace();
Log.d("END OF BSH", "END OF BSH");
}
}
};
thread.start();
thread.interrupt();