Reputation: 69
could you please explain me why i can't start my activity from broadcast reciever with 5 sec. delay in this way.
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
context.startActivity(i);
},5000);
Handler handler = new Handler();
hanlder.postDelay(new Runnable(){
@Override
public void run() {
context.startActivity(i);
},5000);
}
And if you have any suggestions how to delay activity, I'll be very grateful for advice.
Upvotes: 0
Views: 203