Code example for AudioManager

Methods: adjustStreamVolume

0
		 
		AudioManager manager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
		 
		switch (keyCode) {
		case KeyEvent.KEYCODE_VOLUME_DOWN:
			manager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI);
			return true; 
		case KeyEvent.KEYCODE_VOLUME_UP:
			manager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI);
			return true; 
		} 
		 
		return super.onKeyDown(keyCode, event);
	} 
	 
	/** 
	 * <p>operation when touch  to double finger</p> 
	 * @param view		ScanvasContainer in ImageEditor	 
	 * @param event		{@link MotionEvent} 
	 * @return			Whether the event is handled 
	 */