Code example for AudioManager

Methods: abandonAudioFocus

0
	/** 
	 * オーディオフォーカスを手放すことを試みる。 
	 * @return リクエストが成功したかどうか 
	 */ 
	public boolean abandonFocus() { 
		return AudioManager.AUDIOFOCUS_REQUEST_GRANTED == mAM.abandonAudioFocus(this);
	} 
 
	@Override 
	public void onAudioFocusChange(int focusChange) {
		switch (focusChange) {
		case AudioManager.AUDIOFOCUS_GAIN:
			mFocusable.onGainedAudioFocus();
			break; 
		case AudioManager.AUDIOFOCUS_LOSS:
		case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT:
			mFocusable.onLostAudioFocus(false);
			break; 
		case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK:
			mFocusable.onLostAudioFocus(true);
			break;