Partager via


AudioFocusRequestClass.Builder Constructors

Definition

Overloads

AudioFocusRequestClass.Builder(AudioFocus)

Constructs a new Builder, and specifies how audio focus will be requested.

AudioFocusRequestClass.Builder(AudioFocusRequestClass)

Constructs a new Builder with all the properties of the AudioFocusRequest passed as parameter.

AudioFocusRequestClass.Builder(AudioFocus)

Constructs a new Builder, and specifies how audio focus will be requested.

[Android.Runtime.Register(".ctor", "(I)V", "", ApiSince=26)]
public Builder (Android.Media.AudioFocus focusGain);
[<Android.Runtime.Register(".ctor", "(I)V", "", ApiSince=26)>]
new Android.Media.AudioFocusRequestClass.Builder : Android.Media.AudioFocus -> Android.Media.AudioFocusRequestClass.Builder

Parameters

focusGain
AudioFocus

the type of audio focus gain that will be requested

Attributes

Remarks

Constructs a new Builder, and specifies how audio focus will be requested. Valid values for focus requests are AudioManager#AUDIOFOCUS_GAIN, AudioManager#AUDIOFOCUS_GAIN_TRANSIENT, AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK, and AudioManager#AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE.

By default there is no focus change listener, delayed focus is not supported, ducking is suitable for the application, and the AudioAttributes have a usage of AudioAttributes#USAGE_MEDIA.

Java documentation for android.media.AudioFocusRequest.Builder.AudioFocusRequest$Builder(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

AudioFocusRequestClass.Builder(AudioFocusRequestClass)

Constructs a new Builder with all the properties of the AudioFocusRequest passed as parameter.

[Android.Runtime.Register(".ctor", "(Landroid/media/AudioFocusRequest;)V", "", ApiSince=26)]
public Builder (Android.Media.AudioFocusRequestClass requestToCopy);
[<Android.Runtime.Register(".ctor", "(Landroid/media/AudioFocusRequest;)V", "", ApiSince=26)>]
new Android.Media.AudioFocusRequestClass.Builder : Android.Media.AudioFocusRequestClass -> Android.Media.AudioFocusRequestClass.Builder

Parameters

requestToCopy
AudioFocusRequestClass

the non-null AudioFocusRequest to build a duplicate from.

Attributes

Remarks

Constructs a new Builder with all the properties of the AudioFocusRequest passed as parameter. Use this method when you want a new request to differ only by some properties.

Java documentation for android.media.AudioFocusRequest.Builder.AudioFocusRequest$Builder(android.media.AudioFocusRequest).

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