Code example for Handler

Methods: hasMessages

0
        stopSelf();
        mNM.cancel(TIMER_NOTIFICATION);
    } 
 
    public boolean isTimerRunning() { 
        return mHandler.hasMessages(0);
    } 
 
    public void resetTimer() { 
        stopTimer(); 
        timerStopped(mTime);
        mTime = 0;
    } 
 
    /** 
     * Shows the timer notification 
     */ 
    private void showNotification() { 
        mNotification = new Notification(R.drawable.icon, null, System.currentTimeMillis());
        mNotification.flags = Notification.FLAG_ONGOING_EVENT;