Context.IsUiContext 속성

정의

컨텍스트가 , android.view.LayoutInflater LayoutInflater 또는 android.app.WallpaperManager WallpaperManager와 같은 WindowManagerUI 구성 요소에 액세스할 수 있는 UI 컨텍스트인 경우 를 반환 true 합니다.

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

속성 값

특성

설명

컨텍스트가 , android.view.LayoutInflater LayoutInflater 또는 android.app.WallpaperManager WallpaperManager와 같은 WindowManagerUI 구성 요소에 액세스할 수 있는 UI 컨텍스트인 경우 를 반환 true 합니다. 가 사용하도록 설정된 경우 비 UI 컨텍스트에서 UI 구성 요소에 액세스하면 android.os.StrictMode.VmPolicy.Builder#detectIncorrectContextUse() throw됩니다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().

이 페이지의 일부는 만들고 공유하며 에 설명된 용어에 따라 사용되는 작업을 기반으로 수정됩니다.

적용 대상