I am using Runnable thread which is looks like this:
private void startCalculateThread() { new Thread(new Runnable() { @Override public void run() { try { // calculatingSomething(); } catch (Exception e) { throw new RuntimeException(); } } }).start(); } Then I am calling this startCalculateThread method in some other method calculate like this:
private void calculate(final String message){ startCalculateThread(); } I am throwing RuntimeException from new Thread in startCalculateThread method. I figured out I can use Callable but I don't want to do that. Can someone tell how to get thrown exception from thread into calling method calculate.
calculatehas long finished when the thread is still running and eventually throwing.