Udostępnij za pośrednictwem


AudioManager.AdjustVolume(Adjust, VolumeNotificationFlags) Method

Definition

Adjusts the volume of the most relevant stream.

[Android.Runtime.Register("adjustVolume", "(II)V", "GetAdjustVolume_IIHandler")]
public virtual void AdjustVolume (Android.Media.Adjust direction, Android.Media.VolumeNotificationFlags flags);
[<Android.Runtime.Register("adjustVolume", "(II)V", "GetAdjustVolume_IIHandler")>]
abstract member AdjustVolume : Android.Media.Adjust * Android.Media.VolumeNotificationFlags -> unit
override this.AdjustVolume : Android.Media.Adjust * Android.Media.VolumeNotificationFlags -> unit

Parameters

direction
Adjust

The direction to adjust the volume. One of #ADJUST_LOWER, #ADJUST_RAISE, #ADJUST_SAME, #ADJUST_MUTE, #ADJUST_UNMUTE, or #ADJUST_TOGGLE_MUTE.

Attributes

Remarks

Adjusts the volume of the most relevant stream. For example, if a call is active, it will have the highest priority regardless of if the in-call screen is showing. Another example, if music is playing in the background and a call is not active, the music stream will be adjusted.

This method should only be used by applications that replace the platform-wide management of audio settings or the main telephony application.

This method has no effect if the device implements a fixed volume policy as indicated by #isVolumeFixed().

Java documentation for android.media.AudioManager.adjustVolume(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • <xref:Android.Media.AudioManager.AdjustSuggestedStreamVolume(Android.Media.Adjust%2c+Android.Media.Stream%2c+Android.Media.Stream)>
  • <xref:Android.Media.AudioManager.AdjustStreamVolume(Android.Media.Stream%2c+Android.Media.Adjust%2c+Android.Media.Adjust)>
  • <xref:Android.Media.AudioManager.SetStreamVolume(Android.Media.Stream%2c+System.Int32%2c+System.Int32)>
  • IsVolumeFixed