Udostępnij za pośrednictwem


AudioManager.AdjustStreamVolume Method

Definition

Adjusts the volume of a particular stream by one step in a direction.

[Android.Runtime.Register("adjustStreamVolume", "(III)V", "GetAdjustStreamVolume_IIIHandler")]
public virtual void AdjustStreamVolume (Android.Media.Stream streamType, Android.Media.Adjust direction, Android.Media.VolumeNotificationFlags flags);
[<Android.Runtime.Register("adjustStreamVolume", "(III)V", "GetAdjustStreamVolume_IIIHandler")>]
abstract member AdjustStreamVolume : Android.Media.Stream * Android.Media.Adjust * Android.Media.VolumeNotificationFlags -> unit
override this.AdjustStreamVolume : Android.Media.Stream * Android.Media.Adjust * Android.Media.VolumeNotificationFlags -> unit

Parameters

streamType
Stream

The stream type to adjust. One of #STREAM_VOICE_CALL, #STREAM_SYSTEM, #STREAM_RING, #STREAM_MUSIC, #STREAM_ALARM or #STREAM_ACCESSIBILITY.

direction
Adjust

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

Attributes

Remarks

Adjusts the volume of a particular stream by one step in a direction.

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().

From N onward, ringer mode adjustments that would toggle Do Not Disturb are not allowed unless the app has been granted Do Not Disturb Access. See NotificationManager#isNotificationPolicyAccessGranted().

Java documentation for android.media.AudioManager.adjustStreamVolume(int, 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.AdjustVolume(Android.Media.Adjust%2c+Android.Media.VolumeNotificationFlags)>
  • <xref:Android.Media.AudioManager.SetStreamVolume(Android.Media.Stream%2c+System.Int32%2c+System.Int32)>