List of usage examples for android.media AudioManager ADJUST_MUTE
int ADJUST_MUTE
To view the source code for android.media AudioManager ADJUST_MUTE.
Click Source Link
From source file:com.android.msahakyan.fma.fragment.TrackDetailFragment.java
private void mute(boolean mute) { AudioManager audioManager = (AudioManager) activity.getSystemService(Context.AUDIO_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (!audioManager.isStreamMute(AudioManager.STREAM_MUSIC)) { audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, mute ? AudioManager.ADJUST_MUTE : AudioManager.ADJUST_UNMUTE, 0); }/* w ww. j av a2 s . c o m*/ } else { audioManager.setStreamMute(AudioManager.STREAM_MUSIC, mute); } }