語言

Instrumentation.TargetContext 屬性

定義

回傳被安裝的目標應用程式的上下文。

public virtual Android.Content.Context? TargetContext { [Android.Runtime.Register("getTargetContext", "()Landroid/content/Context;", "GetGetTargetContextHandler")] get; }
[<get: Android.Runtime.Register("getTargetContext", "()Landroid/content/Context;", "GetGetTargetContextHandler")>]
member this.TargetContext : Android.Content.Context

屬性值

目標應用程式中的一個上下文。

屬性

備註

回傳被安裝的目標應用程式的上下文。 請注意,這通常與儀器程式碼的上下文不同,因為儀器程式碼的套件通常與其所執行的應用程式的套件不同。 請參見 getContext() 以取得儀器程式碼的 Context。

另請參閱:

Android 參考資料。android.app.Instrumentation.getTargetContext

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

適用於