Code example for Service

Methods: stopForeground

0
     * Hides the notification.  Call this when the timer is stopped. 
     */ 
    public void makeInactive() { 
        if(mShowingNotification) {
            mWakeLock.release();
            mService.stopForeground(true);
            if (mBellRepeater != null) mBellRepeater.stop();
            mVibrator.cancel();
            mShowingNotification = false;
        } 
    } 
 
    /** 
     * Plays a single bell. 
     * Intended for use directly with a user button. 
     */ 
    public void playSingleBell() { 
        BellSoundInfo bellInfo = new BellSoundInfo(1);
        playBell(bellInfo);
    }