And after 5 seconds, rest of the code will run.
I did below code but somehow it is not working:
final String[] quoteData = new String[1];
new java.util.Timer().schedule(
new java.util.TimerTask() {
@Override
public void run() {
// your code here
quoteData[0] = getQuote();
Log.e("DAI", quoteData[0]);
}
},
5000
);
Any thoughts?
And one more thing, here also see I just need String variable but for the Thread it forces me to make the String variable final and array too 😭
Thanks!