Code example for AudioManager

Methods: requestAudioFocus

0
	/** 
	 * Calls {@link AudioManager#requestAudioFocus(AudioManager.OnAudioFocusChangeListener, int, int)} 
	 */ 
	public static void requestAudioFocus(AudioManager manager)
	{ 
		manager.requestAudioFocus(sAudioFocus, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);
	} 
 
	@Override 
	public void onAudioFocusChange(int type)
	{ 
		PlaybackService service = PlaybackService.sInstance;
		if (service != null) {
			service.onAudioFocusChange(type);
		} 
	} 
 
	/** 
	 * Calls {@link VelocityTracker#getYVelocity(int)}. 
	 */ 
	public static float getYVelocity(VelocityTracker tracker, int id)