List of usage examples for android.media AudioManager ADJUST_UNMUTE
int ADJUST_UNMUTE
To view the source code for android.media AudioManager ADJUST_UNMUTE.
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); }//from w w w .ja va 2s . co m } else { audioManager.setStreamMute(AudioManager.STREAM_MUSIC, mute); } }