Code example for Handler

Methods: removeMessages

0
        return new TimerPausedEvent(isPaused);
    } 
 
    @Subscribe 
    public void onStopEvent(StopTimerEvent stopEvent) {
 
        timerHandler.removeMessages(TICK_WHAT);
        stopSelf();
    } 
 
    @Subscribe 
    public void onPauseEvent(PauseTimerEvent pauseEvent) {
        pauseTimer(); 
    } 
 
    /** 
     * Pauses the active running timer and updates the notification in the status bar. 
     */ 
    private void pauseTimer() { 
 
        updateNotification(getString(R.string.timer_is_paused));