I want to execute a Runnable from a method in my application class, but it does not work. I get the message "Runnable created", but it seems that it never reaches the run()-Method.
I call the method setCountDownAfterLeavingBus() in the Callback-Method didExitRegion(Region region) which is part of the BootstrapNotifier-Interface (Android Beacon Library).
Everything works well if I call setCountDownAfterLeavingBus() from onCreate(), but it doesn't work if I call it from the Callback-Method.
public void setCountDownAfterLeavingBus()
{
_handlerCountdownBus = new Handler();
_runnableForHandlerCountdownBus = new CountDownAfterLavingBusRunnable();
_handlerCountdownBus.postDelayed(_runnableForHandlerCountdownBus,1000);
}
private class CountDownAfterLavingBusRunnable implements Runnable
{
public CountDownAfterLavingBusRunnable()
{
Log.e("Runnable", " created");
}
@Override
public void run() {
Log.e("Timer", " terminated");
}
}
I hope you can help me. Best regards, Felix