use of com.omkarmoghe.pokemap.models.events.MarkerUpdate in project Pokemap by omkarmoghe.
the class MarkerRefreshController method startTimer.
public void startTimer(long duration) {
if (mTimer != null) {
mTimer.cancel();
}
if (duration <= 0) {
return;
}
final MarkerUpdate event = new MarkerUpdate();
mTimer = new CountDownTimer(duration, DEFAULT_UPDATE_INTERVAL) {
@Override
public void onTick(long l) {
EventBus.getDefault().post(event);
}
@Override
public void onFinish() {
mTimer = null;
EventBus.getDefault().post(event);
}
};
mTimer.start();
}
Aggregations