Context.IsUiContext プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
true
コンテキストが、、 android.app.WallpaperManager WallpaperManager
などの WindowManager
android.view.LayoutInflater LayoutInflater
UI コンポーネントにアクセスできる UI コンテキストである場合は を返します。
public virtual bool IsUiContext { [Android.Runtime.Register("isUiContext", "()Z", "GetIsUiContextHandler", ApiSince=31)] get; }
[<get: Android.Runtime.Register("isUiContext", "()Z", "GetIsUiContextHandler", ApiSince=31)>]
member this.IsUiContext : bool
プロパティ値
- 属性
注釈
true
コンテキストが、、 android.app.WallpaperManager WallpaperManager
などの WindowManager
android.view.LayoutInflater LayoutInflater
UI コンポーネントにアクセスできる UI コンテキストである場合は を返します。 が有効になっている場合android.os.StrictMode.VmPolicy.Builder#detectIncorrectContextUse()
、UI 以外のコンテキストから UI コンポーネントにアクセスすると がスローされますandroid.os.strictmode.Violation
。
UI コンテキストの例としては、 android.app.Activity Activity
や から #createWindowContext(int, Bundle)
作成されたコンテキストがあります。 android.inputmethodservice.InputMethodService InputMethodService
プログラムで許可されている場合でも、このメソッドをオーバーライドして検証をバイパス android.os.strictmode.IncorrectContextUseViolation
することは推奨されないことに注意してください。
の Java ドキュメント android.content.Context.isUiContext()
。
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。