語言

SoundPool.Builder.SetContext(Context) 方法

定義

設定 SoundPool 所屬的上下文。

[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

參數

context
Context

非空上下文實例

傳回

同一個建造者實例。 這個值不可能為零值。

屬性

備註

設定 SoundPool 所屬的上下文。 上下文將用來擷取資訊,例如AttributionSource及裝置專屬音訊會話ID,這些都會與SoundPool相關聯。 然而,初始化後 SoundPool 實例不會保留上下文本身。

Android 參考資料。android.media.SoundPool.Builder.setContext

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於