I am working at an android application in android studio using java.
I am creating a runnable with some parameters. Call thread function is creating a new thread and after creating this new thread I want for the main thread to wait for 4 seconds (without crashing the UI). It looked everywhere and I can't seem to get an answer for this question
Runnable runnable;
runnable = new timedVisibility(calibratePointList,0,1,ok);
callThreadFunction(runnable);
try {
Thread.currentThread().wait(4000);
}
catch (Exception e)
{
}
This is the callThreadFunction:
Thread t1 = new Thread(runnable);
t1.start();
try {
t1.join();
}
catch (Exception e)
{
System.out.println("Error caught");
}