Android.Media.AudioManager.RequestAudioFocus Method
Request audio focus.

Syntax

[Android.Runtime.Register("requestAudioFocus", "(Landroid/media/AudioManager$OnAudioFocusChangeListener;II)I", "GetRequestAudioFocus_Landroid_media_AudioManager_OnAudioFocusChangeListener_IIHandler")]
[return:Android.Runtime.GeneratedEnum]
public virtual AudioFocusRequest RequestAudioFocus (AudioManager.IOnAudioFocusChangeListener l, [Android.Runtime.GeneratedEnum] Stream streamType, [Android.Runtime.GeneratedEnum] AudioFocus durationHint)

Parameters

l
the listener to be notified of audio focus changes
streamType
the main audio stream type affected by the focus request
durationHint
use AudioManager.AudiofocusGainTransient to indicate this focus request is temporary, and focus will be abandonned shortly. Examples of transient requests are for the playback of driving directions, or notifications sounds. Use AudioManager.AudiofocusGainTransientMayDuck to indicate also that it's ok for the previous focus owner to keep playing if it ducks its audio output. Alternatively use AudioManager.AudiofocusGainTransientExclusive for a temporary request that benefits from the system not playing disruptive sounds like notifications, for usecases such as voice memo recording, or speech recognition. Use AudioManager.AudiofocusGain for a focus request of unknown duration such as the playback of a song or a video.

Returns

Documentation for this section has not yet been entered.

Remarks

Request audio focus. Send a request to obtain the audio focus

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8