I need to start background task. Task call async http request and if condition is valid show alert.
I implemented it but I receive this error:
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
This is my java code:
Timer timer = new Timer();
timer.schedule(new RequestScheduledTask(), intervalTask);
class RequestScheduledTask extends TimerTask {
@Override
public void run() {
myCall();
}
}
Can you help me please?
Thanks
Luca