Code example for WifiManager.WifiLock

Methods: isHeld, release

0
            mPlayer = null;
        } 
 
        // release the Wifi lock, if holding it 
        if (mWifiLock.isHeld()) {
            mWifiLock.release();
        } 
    } 
 
     
    /** 
     * Fully releases the audio focus. 
     */ 
    private void giveUpAudioFocus() { 
        if (mAudioFocus == AudioFocus.FOCUS 
                && mAudioManager != null  
                && AudioManager.AUDIOFOCUS_REQUEST_GRANTED == mAudioManager.abandonAudioFocus(this))  {
             
            mAudioFocus = AudioFocus.NO_FOCUS;
        } 
    }