Language

SoundPool.Builder.SetContext(Context) Method

Definition

Sets the context the SoundPool belongs to.

[Android.Runtime.Register("setContext", "(Landroid/content/Context;)Landroid/media/SoundPool$Builder;", "GetSetContext_Landroid_content_Context_Handler", ApiSince=34)]
public virtual Android.Media.SoundPool.Builder SetContext(Android.Content.Context context);
[<Android.Runtime.Register("setContext", "(Landroid/content/Context;)Landroid/media/SoundPool$Builder;", "GetSetContext_Landroid_content_Context_Handler", ApiSince=34)>]
abstract member SetContext : Android.Content.Context -> Android.Media.SoundPool.Builder
override this.SetContext : Android.Content.Context -> Android.Media.SoundPool.Builder

Parameters

context
Context

a non-null Context instance

Returns

the same Builder instance. This value cannot be null.

Attributes

Remarks

Sets the context the SoundPool belongs to. The context will be used to pull information, such as AttributionSource and device specific audio session ids, which will be associated with the SoundPool. However, the context itself will not be retained by the SoundPool instance after initialization.

Android reference for android.media.SoundPool.Builder.setContext.

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