ContextWrapper 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代理實作的上下文,將所有呼叫委派給另一個上下文。
[Android.Runtime.Register("android/content/ContextWrapper", DoNotGenerateAcw=true)]
public class ContextWrapper : Android.Content.Context
[<Android.Runtime.Register("android/content/ContextWrapper", DoNotGenerateAcw=true)>]
type ContextWrapper = class
inherit Context
- 繼承
- 衍生
- 屬性
備註
代理實作的上下文,將所有呼叫委派給另一個上下文。 可以子類別以修改行為,而不改變原始上下文。
Java 文件 android.content.ContextWrapper。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
建構函式
| 名稱 | Description |
|---|---|
| ContextWrapper(Context) | |
| ContextWrapper(IntPtr, JniHandleOwnership) |
用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。 |
欄位
| 名稱 | Description |
|---|---|
| AccessibilityService |
使用 with |
| AccountService |
使用 with |
| ActivityService |
使用 來 |
| AdvancedProtectionService |
使用 以 |
| AlarmService |
使用 with |
| AppFunctionService |
用 來 |
| AppOpsService |
使用 with |
| AppSearchService |
用 來 |
| AppwidgetService |
使用 with |
| AudioService |
使用來 |
| BatteryService |
用 來 |
| BindAllowActivityStarts |
已淘汰.
標記 |
| BindExternalServiceLong |
其運作方式與 相同 |
| BindNotPerceptible |
已淘汰.
標記: |
| BindPackageIsolatedProcess |
已淘汰.
標記 |
| BindSharedIsolatedProcess |
已淘汰.
標記為 |
| BiometricService |
用 with |
| BlobStoreService |
使用 with |
| BluetoothService |
用 來 |
| BugreportService |
服務用來擷取錯誤報告。 (繼承來源 Context) |
| CameraService |
用 來 |
| CaptioningService |
使用 with |
| CarrierConfigService |
使用 來 |
| ClipboardService |
使用 with |
| CompanionDeviceService |
使用 with |
| ConnectivityDiagnosticsService |
使用來 |
| ConnectivityService |
使用 with |
| ConsumerIrService |
使用時 |
| ContactKeysService |
使用來 |
| CredentialService |
使用 with |
| CrossProfileAppsService |
使用 with |
| DeviceIdDefault |
預設裝置 ID,即主要(非虛擬)裝置的 ID。 (繼承來源 Context) |
| DeviceIdInvalid |
裝置 ID 無效。 (繼承來源 Context) |
| DeviceLockService |
使用 with |
| DevicePolicyService |
使用 with |
| DisplayHashService |
使用 to |
| DisplayService |
使用 with |
| DomainVerificationService |
使用 to |
| DownloadService |
使用 with |
| DropboxService |
用 來 |
| EuiccService |
用 來 |
| FileIntegrityService |
使用 以 |
| FingerprintService |
使用來 |
| GameService |
使用 with |
| GrammaticalInflectionService |
使用 with |
| HardwarePropertiesService |
使用 with |
| HealthconnectService |
使用 with |
| InputMethodService |
使用 with |
| InputService |
使用 來 |
| IpsecService |
使用 with |
| JobSchedulerService |
用 with |
| KeyguardService |
用 來 |
| KeystoreService |
使用 with |
| LauncherAppsService |
使用 with |
| LayoutInflaterService |
在此語境下,使用 with |
| LocaleService |
使用 with |
| LocationService |
使用 with |
| MediaCommunicationService |
使用 來 |
| MediaMetricsService |
使用 with |
| MediaProjectionService |
使用 with |
| MediaQualityService |
使用 with |
| MediaRouterService |
使用 with |
| MediaSessionService |
使用 with |
| MidiService |
使用 with |
| NetworkStatsService |
用 來 |
| NfcService |
使用 with |
| NotificationService |
使用 with |
| NsdService |
使用 with |
| OverlayService |
用 來 |
| PeopleService |
使用 with |
| PerformanceHintService |
使用 來 |
| PersistentDataBlockService |
用 來 |
| PowerService |
用 來 |
| PrintService |
|
| ProfilingService |
使用 以 |
| ReceiverExported |
已淘汰.
標記: |
| ReceiverNotExported |
已淘汰.
標記 |
| ReceiverVisibleToInstantApps |
已淘汰.
標記: |
| RestrictionsService |
使用 with |
| RoleService |
使用 with |
| SatelliteService |
使用 with |
| SearchService |
使用 with |
| SecurityStateService |
使用 with |
| SensorService |
用 來 |
| ShortcutService |
用 with |
| StatusBarService |
用 來 |
| StorageService |
使用 來 |
| StorageStatsService |
使用 with |
| SystemHealthService |
用 來 |
| TelecomService |
使用 with |
| TelephonyImsService |
使用 以 |
| TelephonyService |
使用 來 |
| TelephonySubscriptionService |
使用 with |
| TetheringService |
使用 with |
| TextClassificationService |
使用 with |
| TextServicesManagerService |
使用 with |
| TvAdService |
使用 with |
| TvInputService |
用 來 |
| TvInteractiveAppService |
使用 with |
| UiModeService |
用 來 |
| UsageStatsService |
用 來 |
| UsbService |
用 來 |
| UserService |
使用 with |
| VibratorManagerService |
使用來 |
| VibratorService |
使用來 |
| VirtualDeviceService |
使用 with |
| VpnManagementService |
使用 with |
| WallpaperService |
用 with |
| WifiAwareService |
使用 with |
| WifiP2pService |
使用 with |
| WifiRttRangingService |
用 with |
| WifiService |
使用 with |
| WindowService |
使用 with |
屬性
| 名稱 | Description |
|---|---|
| ApplicationContext |
回傳目前程序單一全域應用程式物件的上下文。 |
| ApplicationInfo |
請回傳本情境套件的完整應用程式資訊。 |
| Assets |
回傳一個 AssetManager 實例,針對你的應用程式套件。 |
| AttributionSource |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Context) |
| AttributionTag |
歸因可以在複雜的應用程式中用來邏輯地區分應用程式的各個部分。 (繼承來源 Context) |
| BaseContext | |
| CacheDir |
回傳檔案系統中應用程式專屬快取目錄的絕對路徑。 |
| Class |
回傳此 |
| ClassLoader |
回傳一個你可以用來擷取這個套件裡的類別載入器。 |
| CodeCacheDir |
回傳用於儲存快取程式碼的檔案系統中應用程式專屬快取目錄的絕對路徑。 |
| ContentResolver |
回傳一個 ContentResolver 實例,針對你的應用程式套件。 |
| DataDir |
代理實作的上下文,將所有呼叫委派給另一個上下文。 |
| DeviceId |
會取得該上下文所關聯的裝置 ID。 (繼承來源 Context) |
| Display |
取得這個情境所關聯的顯示。 (繼承來源 Context) |
| ExternalCacheDir |
回傳主要外部檔案系統目錄的絕對路徑(該目錄位於 ExternalStorageDirectory 應用程式可放置快取檔案的位置)。 |
| FilesDir |
回傳檔案系統中存放檔案 OpenFileOutput(String, FileCreationMode) 的目錄的絕對路徑。 |
| Handle |
底層 Android 實例的帳號。 (繼承來源 Object) |
| IsDeviceProtectedStorage |
代理實作的上下文,將所有呼叫委派給另一個上下文。 |
| IsRestricted |
表示此上下文是否受限。 (繼承來源 Context) |
| IsUiContext |
如果上下文是可存取 、 或 |
| JniIdentityHashCode |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| JniPeerMembers |
代理實作的上下文,將所有呼叫委派給另一個上下文。 |
| MainExecutor |
回傳 和 |
| MainLooper |
回傳當前程序主執行緒的 Looper。 |
| NoBackupFilesDir |
回傳檔案系統目錄的絕對路徑,類似 FilesDir。 |
| ObbDir |
回傳該應用程式的 OBB 檔案(若有)可找到的主要外部儲存目錄。 |
| OpPackageName |
回傳這個上下文中應該用於 |
| PackageCodePath |
回傳完整路徑至此情境的主要 Android 套件。 |
| PackageManager |
回傳 PackageManager 實例以查找全域套件資訊。 |
| PackageName |
回傳這個應用程式的套件名稱。 |
| PackageResourcePath |
回傳完整路徑至此情境的主要 Android 套件。 |
| Params |
回傳該上下文所用的參數集合,若是透過 |
| PeerReference |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| Resources |
回傳一個應用程式套件的 Resources 實例。 |
| Theme |
回傳與此上下文相關的主題物件。 |
| ThresholdClass |
此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。 |
| ThresholdType |
此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。 |
| Wallpaper | |
| WallpaperDesiredMinimumHeight | |
| WallpaperDesiredMinimumWidth | |
方法
明確介面實作
| 名稱 | Description |
|---|---|
| IJavaPeerable.Disposed() |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| IJavaPeerable.DisposeUnlessReferenced() |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| IJavaPeerable.Finalized() |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| IJavaPeerable.JniManagedPeerState |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
| IJavaPeerable.SetPeerReference(JniObjectReference) |
代理實作的上下文,將所有呼叫委派給另一個上下文。 (繼承來源 Object) |
擴充方法
| 名稱 | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
取得實例 |
| JavaAs<TResult>(IJavaPeerable) |
試著強制 |
| JavaCast<TResult>(IJavaObject) |
執行 Android 執行時檢查型別轉換。 |
| JavaCast<TResult>(IJavaObject) |
代理實作的上下文,將所有呼叫委派給另一個上下文。 |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
試著強制 |