Context 類別

定義

介面連接全域應用程式環境資訊。

[Android.Runtime.Register("android/content/Context", DoNotGenerateAcw=true)]
public abstract class Context : Java.Lang.Object
[<Android.Runtime.Register("android/content/Context", DoNotGenerateAcw=true)>]
type Context = class
    inherit Object
繼承
Context
衍生
屬性

備註

介面連接全域應用程式環境資訊。 這是一個抽象類別,其實作由 Android 系統提供。 它允許存取特定應用程式的資源與類別,以及應用程式層級操作的上啟呼叫,例如啟動活動、廣播與接收意圖等。

Java 文件 android.content.Context

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

建構函式

名稱 Description
Context()
Context(IntPtr, JniHandleOwnership)

用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。

欄位

名稱 Description
AccessibilityService

使用 with #getSystemService(String) 來取得 a android.view.accessibility.AccessibilityManager ,以便透過註冊事件監聽器向使用者提供 UI 事件的回饋。

AccountService

使用 with #getSystemService(String) 來取得 a android.accounts.AccountManager 以在你選擇的時間接收意圖。

ActivityService

使用 來 #getSystemService(String) 取得 a android.app.ActivityManager 以與全域系統狀態互動。

AdvancedProtectionService

使用 以 #getSystemService(String) 取得 android.security.advancedprotection.AdvancedProtectionManager

AlarmService

使用 with #getSystemService(String) 來取得 a android.app.AlarmManager 以在你選擇的時間接收意圖。

AppFunctionService

用 來#getSystemService(String)取得執行應用程式函式的 。AppFunctionManager

AppOpsService

使用 with #getSystemService(String) 來取得 a android.app.AppOpsManager 以追蹤裝置上的應用程式操作。

AppSearchService

用 來 #getSystemService(String) 取得 android.app.appsearch.AppSearchManager 系統管理的索引與查詢應用程式資料。

AppwidgetService

使用 with #getSystemService(String) 來取得 a android.appwidget.AppWidgetManager 以存取 AppWidgets。

AudioService

使用來 #getSystemService(String) 取得 a android.media.AudioManager ,以處理音量管理、鈴聲模式及音訊路由。

BatteryService

用 來 #getSystemService(String) 取得 a android.os.BatteryManager 來管理電池狀態。

BindAllowActivityStarts
已淘汰.

標記 #bindService:若綁定來自可見的應用程式,綁定服務可從背景啟動活動。

BindExternalServiceLong

其運作方式與 相同 #BIND_EXTERNAL_SERVICE,但定義為 longBindServiceFlags相容的值。

BindNotPerceptible
已淘汰.

標記: #bindService若綁定來自可見或使用者可感知的應用程式,則將目標服務的重要性降至可感知以下。

BindPackageIsolatedProcess
已淘汰.

標記 #bindIsolatedService:將服務綁定為共享的獨立程序,但僅限於與同一套件中宣告相同程序名稱的其他孤立服務綁定。

BindSharedIsolatedProcess
已淘汰.

標記為 #bindIsolatedService:將服務綁定成共享且隔離的程序。

BiometricService

用 with #getSystemService(String) 來取得 a android.hardware.biometrics.BiometricManager 來處理生物識別和 PIN/模式/密碼驗證。

BlobStoreService

使用 with #getSystemService(String) 來取得 a android.app.blob.BlobStoreManager ,以便貢獻並存取系統維護的 blob 儲存庫中的資料 blob。

BluetoothService

用 來 #getSystemService(String) 取得 a android.bluetooth.BluetoothManager 以使用藍牙。

BugreportService

服務用來擷取錯誤報告。

CameraService

用 來 #getSystemService(String) 取得 a android.hardware.camera2.CameraManager 以與相機裝置互動。

CaptioningService

使用 with #getSystemService(String) 來取得 android.view.accessibility.CaptioningManager 字幕屬性並聆聽字幕偏好的變化。

CarrierConfigService

使用 來 #getSystemService(String) 取得 a android.telephony.CarrierConfigManager 以讀取載波配置值。

ClipboardService

使用 with #getSystemService(String) 來取得 a android.content.ClipboardManager ,以便存取並修改全域剪貼簿的內容。

CompanionDeviceService

使用 with #getSystemService(String) 來取得 a android.companion.CompanionDeviceManager 以管理伴隨裝置

ConnectivityDiagnosticsService

使用來 #getSystemService(String) 取得 a android.net.ConnectivityDiagnosticsManager ,以執行網路連接診斷,並從系統接收網路連接資訊。

ConnectivityService

使用 with #getSystemService(String) 來取得 a android.net.ConnectivityManager 以處理網路連線管理。

ConsumerIrService

使用時 #getSystemService(String) 可從裝置擷取 a android.hardware.ConsumerIrManager 以傳送紅外線訊號。

ContactKeysService

使用來 #getSystemService(String) 取得 A E2eeContactKeysManager 以管理聯絡金鑰。

CredentialService

使用 with #getSystemService(String) 來取得 a android.credentials.CredentialManager 以驗證使用者到你的應用程式。

CrossProfileAppsService

使用 with #getSystemService(String) 來取得交叉剖面操作的 a android.content.pm.CrossProfileApps

DeviceIdDefault

預設裝置 ID,即主要(非虛擬)裝置的 ID。

DeviceIdInvalid

裝置 ID 無效。

DeviceLockService

使用 with #getSystemService(String) 來取得 android.devicelock.DeviceLockManager

DevicePolicyService

使用 with #getSystemService(String) 來取得 a android.app.admin.DevicePolicyManager ,以便處理全域裝置政策管理。

DisplayHashService

使用 to #getSystemService(String) 存取 android.view.displayhash.DisplayHashManager 來處理顯示雜湊值。

DisplayService

使用 with #getSystemService(String) 來取得 a android.hardware.display.DisplayManager 以與顯示裝置互動。

DomainVerificationService

使用 to #getSystemService(String) 存取 android.content.pm.verify.domain.DomainVerificationManager 權以取得已宣告網域的審核與使用者狀態。

DownloadService

使用 with #getSystemService(String) 來取得 a android.app.DownloadManager 以請求 HTTP 下載。

DropboxService

用 來 #getSystemService(String) 擷取 android.os.DropBoxManager 一個實例來記錄診斷日誌。

EuiccService

用 來 #getSystemService(String) 取得 a android.telephony.euicc.EuiccManager 來管理裝置 eUICC(嵌入式 SIM)。

FileIntegrityService

使用 以 #getSystemService(String) 取得 android.security.FileIntegrityManager

FingerprintService

使用來 #getSystemService(String) 取得指紋管理的 a android.hardware.fingerprint.FingerprintManager

GameService

使用 with #getSystemService(String) 來取得 GameManager

GrammaticalInflectionService

使用 with #getSystemService(String) 來取得 GrammaticalInflectionManager

HardwarePropertiesService

使用 with #getSystemService(String) 來取得 a android.os.HardwarePropertiesManager 以存取硬體屬性服務。

HealthconnectService

使用 with #getSystemService(String) 來取得 android.health.connect.HealthConnectManager

InputMethodService

使用 with #getSystemService(String) 來取得 a android.view.inputmethod.InputMethodManager 以存取輸入方法。

InputService

使用 來 #getSystemService(String) 取得 a android.hardware.input.InputManager 以與輸入裝置互動。

IpsecService

使用 with #getSystemService(String) 來取得 a android.net.IpSecManager 以加密 IPSec 的 Sockets 或網路。

JobSchedulerService

用 with #getSystemService(String) 來取得 android.app.job.JobScheduler 一個實例,用於管理偶爾的背景任務。

KeyguardService

用 來 #getSystemService(String) 取得 a android.app.KeyguardManager 以控制 Keyguard。

KeystoreService

使用 with #getSystemService(String) 來取得 a android.security.keystore.KeyStoreManager 以存取 Android Keystore 函式。

LauncherAppsService

使用 with #getSystemService(String) 來取得 android.content.pm.LauncherApps 查詢並監控可啟動應用程式的用戶檔案。

LayoutInflaterService

在此語境下,使用 with #getSystemService(String) 來取得 a android.view.LayoutInflater ,以膨脹版面資源。

LocaleService

使用 with #getSystemService(String) 來取得 android.app.LocaleManager

LocationService

使用 with #getSystemService(String) 來取得 a android.location.LocationManager 以控制位置更新。

MediaCommunicationService

使用 來 #getSystemService(String) 取得 android.media.MediaCommunicationManager 用於管理 android.media.MediaSession2

MediaMetricsService

使用 with #getSystemService(String) 來取得 a android.media.metrics.MediaMetricsManager ,以便與裝置上的媒體指標互動。

MediaProjectionService

使用 with #getSystemService(String) 來取得 android.media.projection.MediaProjectionManager 管理媒體投影會話的實例。

MediaQualityService

使用 with #getSystemService(String) 來取得 a android.media.quality.MediaQuality ,以標準化圖片和音訊 API 參數。

MediaRouterService

使用 with #getSystemService 來取得 a android.media.MediaRouter 以控制和管理媒體路由。

MediaSessionService

使用 with #getSystemService(String) 來取得 a android.media.session.MediaSessionManager 以管理媒體會話。

MidiService

使用 with #getSystemService(String) 來取得 a android.media.midi.MidiManager 以存取 MIDI 服務。

NetworkStatsService

用 來 #getSystemService(String) 取得 a android.app.usage.NetworkStatsManager 以查詢網路使用統計。

NfcService

使用 with #getSystemService(String) 來取得 a android.nfc.NfcManager 以使用 NFC。

NotificationService

使用 with #getSystemService(String) 來取得 a android.app.NotificationManager ,以通知使用者背景事件。

NsdService

使用 with #getSystemService(String) 來取得 a android.net.nsd.NsdManager 以處理網路服務發現管理

OverlayService

用 來 #getSystemService(String) 取得 a android.content.om.OverlayManager 以管理覆蓋層套件。

PeopleService

使用 with #getSystemService(String) 來存取 a PeopleManager ,與你已發表的對話互動。

PerformanceHintService

使用 來 #getSystemService(String) 取得 a android.os.PerformanceHintManager 以存取效能提示服務。

PersistentDataBlockService

用 來 #getSystemService(String) 取得 android.service.persistentdata.PersistentDataBlockManager 一個實例,與存在於出廠重置之間的儲存裝置互動。

PowerService

用 來 #getSystemService(String) 取得 a android.os.PowerManager 來控制電源管理,包括「wake locks」,讓你在執行長時間任務時保持裝置開啟。

PrintService

android.print.PrintManager 用於列印及列印管理及列印任務。

ProfilingService

使用 以 #getSystemService(String) 取得 android.os.ProfilingManager

ReceiverExported
已淘汰.

標記: #registerReceiver接收器可接收來自其他應用程式的廣播。

ReceiverNotExported
已淘汰.

標記 #registerReceiver:接收器無法接收來自其他應用程式的廣播。

ReceiverVisibleToInstantApps
已淘汰.

標記: #registerReceiver接收器可接收來自即時應用程式的廣播。

RestrictionsService

使用 with #getSystemService(String) 來取得 a android.content.RestrictionsManager ,用於擷取應用程式限制並請求受限制操作的權限。

RoleService

使用 with #getSystemService(String) 來取得管理角色的 a android.app.role.RoleManager

SatelliteService

使用 with #getSystemService(String) 來取得 a android.telephony.satellite.SatelliteManager 以存取衛星功能。

SearchService

使用 with #getSystemService(String) 來取得 a android.app.SearchManager 以處理搜尋。

SecurityStateService

使用 with #getSystemService(String) 來取得 a android.os.SecurityStateManager 以存取安全狀態管理器服務。

SensorService

用 來 #getSystemService(String) 取得 a android.hardware.SensorManager 以存取感測器。

ShortcutService

用 with #getSystemService(String) 來取得 a android.content.pm.ShortcutManager 以存取啟動器捷徑服務。

StatusBarService

用 來 #getSystemService(String) 取得 a android.app.StatusBarManager ,以便與狀態列互動及快速設定。

StorageService

使用 來 #getSystemService(String) 取得 a android.os.storage.StorageManager 以存取系統儲存函數。

StorageStatsService

使用 with #getSystemService(String) 來取得 a android.app.usage.StorageStatsManager 以存取系統儲存統計資料。

SystemHealthService

用 來 #getSystemService(String) 取得 android.os.health.SystemHealthManager 系統健康(電池、電力、記憶體等)指標。

TelecomService

使用 with #getSystemService(String) 來取得 a android.telecom.TelecomManager 以管理裝置的電信相關功能。

TelephonyImsService

使用 以 #getSystemService(String) 取得 android.telephony.ims.ImsManager

TelephonyService

使用 來 #getSystemService(String) 取得 a android.telephony.TelephonyManager 以處理裝置的電話功能管理。

TelephonySubscriptionService

使用 with #getSystemService(String) 來取得 a android.telephony.SubscriptionManager 以處理裝置的電話訂閱管理。

TetheringService

使用 with #getSystemService(String) 來取得 a android.net.TetheringManager 以管理繫網功能。

TextClassificationService

使用 with #getSystemService(String) 以取得文字分類服務的 a TextClassificationManager

TextServicesManagerService

使用 with #getSystemService(String) 以取得 android.view.textservice.TextServicesManager 文字服務。

TvAdService

使用 with #getSystemService(String) 來取得 a android.media.tv.ad.TvAdManager ,以便與裝置上的電視客戶端廣告服務互動。

TvInputService

用 來 #getSystemService(String) 取得 a android.media.tv.TvInputManager 以與裝置上的電視輸入互動。

TvInteractiveAppService

使用 with #getSystemService(String) 來取得 a android.media.tv.interactive.TvInteractiveAppManager ,以便與裝置上的電視互動應用程式互動。

UiModeService

用 來 #getSystemService(String) 取得 a android.app.UiModeManager 來控制 UI 模式。

UsageStatsService

用 來 #getSystemService(String) 取得 a android.app.usage.UsageStatsManager 以查詢裝置使用統計。

UsbService

用 來 #getSystemService(String) 取得 A android.hardware.usb.UsbManager ,作為 USB 主機存取 USB 裝置,並控制該裝置作為 USB 裝置的行為。

UserService

使用 with #getSystemService(String) 來取得 a android.os.UserManager ,以管理支援多使用者的裝置上的使用者。

VibratorManagerService

使用來 #getSystemService(String) 取得 a android.os.VibratorManager ,以便存取裝置震動器、與個別震動器互動,並在多個震動器上播放同步效果。

VibratorService

使用來 #getSystemService(String) 取得與振動硬體互動的 a android.os.Vibrator

VirtualDeviceService

使用 with #getSystemService(String) 來取得 a android.companion.virtual.VirtualDeviceManager 以管理虛擬裝置。

VpnManagementService

使用 with #getSystemService(String) 來取得 a android.net.VpnManager 來管理平台內建 VPN 的設定檔。

WallpaperService

用 with #getSystemService(String) 來取回通訊器。

WifiAwareService

使用 with #getSystemService(String) 來取得 a android.net.wifi.aware.WifiAwareManager 以處理 Wi-Fi Aware。

WifiP2pService

使用 with #getSystemService(String) 來取得 a android.net.wifi.p2p.WifiP2pManager 以處理 Wi-Fi 點對點連線的管理。

WifiRttRangingService

用 with #getSystemService(String) 來取得 android.net.wifi.rtt.WifiRttManager 帶有 WiFi 的測距裝置。

WifiService

使用 with #getSystemService(String) 來取得 a android.net.wifi.WifiManager 以處理 Wi-Fi 存取管理。

WindowService

使用 with #getSystemService(String) 來取得 a android.view.WindowManager 以存取系統的視窗管理器。

屬性

名稱 Description
ApplicationContext

回傳目前程序單一全域應用程式物件的上下文。

ApplicationInfo

請回傳本情境套件的完整應用程式資訊。

Assets

回傳一個 AssetManager 實例,針對你的應用程式套件。

AttributionSource

介面連接全域應用程式環境資訊。

AttributionTag

歸因可以在複雜的應用程式中用來邏輯地區分應用程式的各個部分。

CacheDir

回傳檔案系統中應用程式專屬快取目錄的絕對路徑。

Class

回傳此 Object的執行時類別。

(繼承來源 Object)
ClassLoader

回傳一個你可以用來擷取這個套件裡的類別載入器。

CodeCacheDir

回傳用於儲存快取程式碼的檔案系統中應用程式專屬快取目錄的絕對路徑。

ContentResolver

回傳一個 ContentResolver 實例,針對你的應用程式套件。

DataDir

介面連接全域應用程式環境資訊。

DeviceId

會取得該上下文所關聯的裝置 ID。

Display

取得這個情境所關聯的顯示。

ExternalCacheDir

回傳主要外部檔案系統目錄的絕對路徑(該目錄位於 ExternalStorageDirectory 應用程式可放置快取檔案的位置)。

FilesDir

回傳檔案系統中存放檔案 OpenFileOutput(String, FileCreationMode) 的目錄的絕對路徑。

Handle

底層 Android 實例的帳號。

(繼承來源 Object)
IsDeviceProtectedStorage

介面連接全域應用程式環境資訊。

IsRestricted

表示此上下文是否受限。

IsUiContext

如果上下文是可存取 、 或 android.app.WallpaperManager WallpaperManagerandroid.view.LayoutInflater LayoutInflater 等 UI 元件的 UI 上下文WindowManager,則回傳 true

JniIdentityHashCode

介面連接全域應用程式環境資訊。

(繼承來源 Object)
JniPeerMembers

介面連接全域應用程式環境資訊。

MainExecutor

回傳 和 Executor ,會在與此上下文相關的主執行緒上執行已排隊的任務。

MainLooper

回傳當前程序主執行緒的 Looper。

NoBackupFilesDir

回傳檔案系統目錄的絕對路徑,類似 FilesDir

ObbDir

回傳該應用程式的 OBB 檔案(若有)可找到的主要外部儲存目錄。

OpPackageName

回傳這個上下文中應該用於 android.app.AppOpsManager 呼叫的套件名稱,這樣應用程式運維管理員的 UID 驗證就能用這個名稱。

PackageCodePath

回傳完整路徑至此情境的主要 Android 套件。

PackageManager

回傳 PackageManager 實例以查找全域套件資訊。

PackageName

回傳這個應用程式的套件名稱。

PackageResourcePath

回傳完整路徑至此情境的主要 Android 套件。

Params

回傳該上下文所用的參數集合,若是透過 #createContext(ContextParams)建立。

PeerReference

介面連接全域應用程式環境資訊。

(繼承來源 Object)
Resources

回傳一個應用程式套件的 Resources 實例。

Theme

回傳與此上下文相關的主題物件。

ThresholdClass

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

ThresholdType

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

Wallpaper
WallpaperDesiredMinimumHeight
WallpaperDesiredMinimumWidth

方法

名稱 Description
BindIsolatedService(Intent, Context+BindServiceFlags, String, IExecutor, IServiceConnection)

介面連接全域應用程式環境資訊。

BindIsolatedService(Intent, Int32, String, IExecutor, IServiceConnection)

在孤立服務的特定情況下,這種變化 #bindService 允許呼叫者從單一元件宣告產生多個服務實例。

BindService(Intent, Bind, IExecutor, IServiceConnection)

#bindService(Intent, ServiceConnection, int) bindService(Intent, ServiceConnection, int) 執行器一樣,用來控制 ServiceConnection 回調。

BindService(Intent, Context+BindServiceFlags, IExecutor, IServiceConnection)

介面連接全域應用程式環境資訊。

BindService(Intent, IServiceConnection, Bind)

連接應用程式服務,必要時建立服務。

BindService(Intent, IServiceConnection, Context+BindServiceFlags)

介面連接全域應用程式環境資訊。

BindServiceAsUser(Intent, IServiceConnection, Context+BindServiceFlags, UserHandle)

介面連接全域應用程式環境資訊。

BindServiceAsUser(Intent, IServiceConnection, Int32, UserHandle)

以與 相同的方式#bindService綁定於給定user的服務。

CheckCallingOrSelfPermission(String)

確認 IPC <em>或 you</em> 的通話流程是否獲得特定權限。

CheckCallingOrSelfUriPermission(Uri, ActivityFlags)

確認 IPC <em>或 you</em> 的通話流程是否已獲授權存取特定 URI。

CheckCallingOrSelfUriPermissions(IList<Uri>, Int32)

確認 IPC <em>或 you</em> 的呼叫過程是否已被授權存取 URI 清單。

CheckCallingPermission(String)

確認你所處理的 IPC 的通話流程是否已獲得特定權限。

CheckCallingUriPermission(Uri, ActivityFlags)

確認呼叫流程與 UID 是否已獲得存取特定 URI 的權限。

CheckCallingUriPermissions(IList<Uri>, Int32)

確認呼叫程序與 UID 是否已獲得存取 URI 清單的權限。

CheckContentUriPermissionFull(Uri, Int32, Int32, ActivityFlags)

確認某個程序和 UID 是否已被授權存取特定內容 URI。

CheckPermission(String, Int32, Int32)

判斷該權限是否允許用於系統中執行的特定程序及使用者 ID。

CheckSelfPermission(String)

確認你</他們>是否<>獲得了特定的授權。

CheckUriPermission(Uri, Int32, Int32, ActivityFlags)

確認某個程序和 UID 是否被授權存取特定 URI。

CheckUriPermission(Uri, String, String, Int32, Int32, ActivityFlags)

檢查 Uri 和一般權限。

CheckUriPermissions(IList<Uri>, Int32, Int32, Int32)

確認某個程序與 UID 是否已被授權存取 URI 清單。

ClearWallpaper()
已淘汰.

此會員已被棄用。

Clone()

建立並回傳此物件的副本。

(繼承來源 Object)
CreateAttributionContext(String)

回傳一個新的 Context 物件,針對目前的 Context,但屬性是不同的標籤。

CreateConfigurationContext(Configuration)

回傳一個新的 Context 物件,針對目前的 Context,但其資源會調整以符合給定的配置。

CreateContext(ContextParams)

建立具有特定屬性與行為的情境。

CreateContextForSplit(String)

為該分割名稱回傳一個新的 Context 物件。

CreateDeviceContext(Int32)

從目前上下文回傳一個新 Context 物件,但裝置關聯由 deviceId給出。

CreateDeviceProtectedStorageContext()

回傳一個新的上下文物件,用於目前上下文,但其儲存 API 由裝置保護儲存所支援。

CreateDisplayContext(Display)

從目前上下文回傳一個新 Context 物件,但資源調整以符合 的 display指標。

CreatePackageContext(String, PackageContextFlags)

為給定的應用程式名稱回傳一個新的 Context 物件。

CreateWindowContext(Display, Int32, Bundle)

為給定Display的非窗口android.app.Activity activity創造 a Context

CreateWindowContext(Int32, Bundle)

為非活動視窗建立一個上下文。

DatabaseList()

回傳一組字串,標示與此上下文應用程式套件相關的私有資料庫。

DeleteDatabase(String)

刪除與此上下文應用程式套件相關的現有私有 SQLiteDatabase。

DeleteFile(String)

刪除與此上下文應用程式套件相關的指定私有檔案。

DeleteSharedPreferences(String)

刪除一個現有的共享偏好設定檔案。

Dispose()

介面連接全域應用程式環境資訊。

(繼承來源 Object)
Dispose(Boolean)

介面連接全域應用程式環境資訊。

(繼承來源 Object)
EnforceCallingOrSelfPermission(String, String)

如果你或你正在處理的 IPC 呼叫程序都沒有獲得特定權限,請拋出 SecurityException

EnforceCallingOrSelfUriPermission(Uri, ActivityFlags, String)

如果 IPC <em>或 you</em> 的呼叫過程尚未被授權存取特定 URI,請拋出 SecurityException

EnforceCallingPermission(String, String)

如果你正在處理的 IPC 呼叫程序尚未獲得特定權限,請拋出 SecurityException

EnforceCallingUriPermission(Uri, ActivityFlags, String)

如果呼叫程序和 UID 尚未獲得存取特定 URI 的權限,請拋出 SecurityException

EnforcePermission(String, Int32, Int32, String)

如果系統中執行的特定程序和使用者 ID 不允許該權限,請拋出 SecurityException

EnforceUriPermission(Uri, Int32, Int32, ActivityFlags, String)

如果某個程序和 UID 尚未被授權存取特定 URI,請拋出 SecurityException

EnforceUriPermission(Uri, String, String, Int32, Int32, ActivityFlags, String)

同時執行 Uri 和一般授權。

Equals(Object)

表示是否有其他物體「等同」於此物。

(繼承來源 Object)
FileList()

回傳一個字串陣列,命名與該上下文應用套件相關的私有檔案。

GetColor(Int32)

回傳與特定資源 ID 相關且依當前主題設計的顏色。

GetColorStateList(Int32)

回傳與特定資源 ID 相關聯的色彩狀態清單,並依當前主題做樣式。

GetDatabasePath(String)

回傳儲存資料庫的檔案系統 #openOrCreateDatabase 絕對路徑。

GetDir(String, FileCreationMode)

擷取並建立一個新的目錄,應用程式可以放置自己的自訂資料檔案。

GetDrawable(Int32)

回傳一個可繪製的物件,與特定資源 ID 相關聯,並依當前主題做樣式。

GetExternalCacheDirs()

回傳所有共享/外部儲存裝置上應用程式專屬目錄的絕對路徑,該應用程式可放置其擁有的快取檔案。

GetExternalFilesDir(String)

回傳主共享/外部儲存裝置目錄的絕對路徑,該應用程式可放置其擁有的持久檔案。

GetExternalFilesDirs(String)

回傳所有共享/外部儲存裝置上應用程式專屬目錄的絕對路徑,該應用程式可在其中放置其擁有的持久檔案。

GetExternalMediaDirs()

回傳所有共享/外部儲存裝置上應用程式專屬目錄的絕對路徑,應用程式可在此放置媒體檔案。

GetFileStreamPath(String)

回傳檔案系統中建立檔案的絕對路徑,該檔案存放於該 #openFileOutput 檔案中。

GetHashCode()

回傳物件的雜湊碼值。

(繼承來源 Object)
GetObbDirs()

回傳所有共享/外部儲存裝置上應用程式專屬目錄的絕對路徑,該目錄可找到該應用程式的 OBB 檔案(若有)。

GetSharedPreferences(String, FileCreationMode)

取回並保留偏好設定檔「名稱」的內容,回傳一個 SharedPreferences,透過它你可以取回並修改其值。

GetString(Int32, Object[])

回傳應用程式套件預設字串表中的本地化字串。

GetString(Int32)

回傳應用程式套件預設字串表中的本地化字串。

GetSystemService(Class)

依類別將句柄回傳至系統層級服務。

GetSystemService(String)

以名稱將句柄回傳給系統層級服務。

GetSystemServiceName(Class)

取得由指定類別所代表的系統層級服務名稱。

GetText(Int32)

從應用程式套件預設字串表回傳一個本地化且有樣式的 CharSequence。

GetTextFormatted(Int32)

從應用程式套件預設字串表回傳一個本地化且有樣式的 CharSequence。

GrantUriPermission(String, Uri, ActivityFlags)

將特定 Uri 存取權限授予另一個套件,不論該套件是否擁有存取該 Uri 內容提供者的一般權限。

JavaFinalize()

當垃圾回收判定該物件不再有相關參考時,由垃圾回收器呼叫。

(繼承來源 Object)
MoveDatabaseFrom(Context, String)

將現有的資料庫檔案從給定的來源儲存上下文移動到這個上下文。

MoveSharedPreferencesFrom(Context, String)

將現有的共享偏好設定檔案從給定的來源儲存上下文移到這個上下文。

Notify()

喚醒一個正在該物件監視器上等待的執行緒。

(繼承來源 Object)
NotifyAll()

喚醒所有等待該物件監視器的執行緒。

(繼承來源 Object)
ObtainStyledAttributes(IAttributeSet, Int32[], Int32, Int32)

在此上下文主題中檢索樣式屬性資訊。

ObtainStyledAttributes(IAttributeSet, Int32[])

在此上下文主題中檢索樣式屬性資訊。

ObtainStyledAttributes(Int32, Int32[])

在此上下文主題中檢索樣式屬性資訊。

ObtainStyledAttributes(Int32[])

在此上下文主題中檢索樣式屬性資訊。

OpenFileInput(String)

開啟與此上下文應用程式套件相關的私人檔案以進行閱讀。

OpenFileOutput(String, FileCreationMode)

開啟與此上下文應用程式套件相關的私有檔案以進行撰寫。

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory, IDatabaseErrorHandler)

開啟與此上下文應用程式套件相關的新私有 SQLiteDatabase。

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory)

開啟與此上下文應用程式套件相關的新私有 SQLiteDatabase。

PeekWallpaper()
已淘汰.

此會員已被棄用。

RegisterComponentCallbacks(IComponentCallbacks)

在 Context 的基礎應用程式中新增 ComponentCallbacks 一個新應用程式,該應用程式會與 ComponentCallbacks 活動及其他元件方法的呼叫同時被呼叫。

RegisterDeviceIdChangeListener(IExecutor, IIntConsumer)

新增一個裝置 ID,變更監聽器到 Context,當系統更改裝置關聯時會呼叫。

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags)
已淘汰.

註冊以接收意圖廣播,接收端可選擇性地暴露給即時應用程式。

RegisterReceiver(BroadcastReceiver, IntentFilter, ReceiverFlags)

介面連接全域應用程式環境資訊。

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags)
已淘汰.

註冊以接收意圖廣播,並在 var>排程器</var> 的情境<下執行。

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ReceiverFlags)

介面連接全域應用程式環境資訊。

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler)

註冊以接收意圖廣播,並在 var>排程器</var> 的情境<下執行。

RegisterReceiver(BroadcastReceiver, IntentFilter)

註冊一個廣播接收器(BroadcastReceiver)以便在主活動執行緒中執行。

RemoveStickyBroadcast(Intent)
已淘汰.

移除之前傳送的資料 #sendStickyBroadcast,讓黏著廣播彷彿從未發生過。

RemoveStickyBroadcastAsUser(Intent, UserHandle)
已淘汰.

那個版本 #removeStickyBroadcast(Intent) 允許你指定廣播要傳送給哪個使用者。

RevokeSelfPermissionOnKill(String)

觸發執行時權限的非同步撤銷。

RevokeSelfPermissionsOnKill(ICollection<String>)

會觸發撤銷呼叫套件一個或多個權限。

RevokeUriPermission(String, Uri, ActivityFlags)

移除先前為特定目標套件新增 #grantUriPermission 的存取特定內容提供者 Uri 的權限。

RevokeUriPermission(Uri, ActivityFlags)

移除先前加入或任何其他機制時新增#grantUriPermission<<>>的存取特定內容提供者 Uri 的權限。

SendBroadcast(Intent, String, Bundle)

將該意圖廣播給所有有興趣的廣播接收器,並允許執行可選的必要許可。

SendBroadcast(Intent, String)

將該意圖廣播給所有有興趣的廣播接收器,並允許執行可選的必要許可。

SendBroadcast(Intent)

將該意圖廣播給所有有興趣的廣播接收器。

SendBroadcastAsUser(Intent, UserHandle, String)

那個版本 #sendBroadcast(Intent, String) 允許你指定廣播要傳送給哪個使用者。

SendBroadcastAsUser(Intent, UserHandle)

那個版本 #sendBroadcast(Intent) 允許你指定廣播要傳送給哪個使用者。

SendBroadcastWithMultiplePermissions(Intent, String[])

將該意圖廣播給所有有興趣的廣播接收器,允許執行一系列必要的權限。

SendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, Result, String, Bundle)

那個版本 #sendBroadcast(Intent) 允許你從廣播中接收回來的資料。

SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle)

那個版本 #sendBroadcast(Intent) 允許你從廣播中接收回來的資料。

SendOrderedBroadcast(Intent, String, Bundle)

將所定意圖廣播給所有有興趣的廣播接收器,一次一個傳送,讓更多優先接收者先消化該廣播,然後再傳送給較不偏好的接收器。

SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle)

那個版本 #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) 允許你指定應用程式操作,來強制限制廣播將傳送到哪些接收器。

SendOrderedBroadcast(Intent, String)

將所定意圖廣播給所有有興趣的廣播接收器,一次一個傳送,讓更多優先接收者先消化該廣播,然後再傳送給較不偏好的接收器。

SendOrderedBroadcastAsUser(Intent, UserHandle, String, BroadcastReceiver, Handler, Result, String, Bundle)

版本 #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) 這樣你就能指定廣播要傳送給哪個使用者。

SendStickyBroadcast(Intent, Bundle)

執行 #sendBroadcast(Intent) 一個「黏性」的行為,意即你傳送的意圖會在廣播完成後仍保留,讓其他人能透過回傳值 #registerReceiver(BroadcastReceiver, IntentFilter)快速取得該資料。

SendStickyBroadcast(Intent)
已淘汰.

執行 #sendBroadcast(Intent) 一個「黏性」的行為,意即你傳送的意圖會在廣播完成後仍保留,讓其他人能透過回傳值 #registerReceiver(BroadcastReceiver, IntentFilter)快速取得該資料。

SendStickyBroadcastAsUser(Intent, UserHandle)
已淘汰.

那個版本 #sendStickyBroadcast(Intent) 允許你指定廣播要傳送給哪個使用者。

SendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, Result, String, Bundle)
已淘汰.

那個版本 #sendStickyBroadcast 允許你從廣播中接收回來的資料。

SendStickyOrderedBroadcastAsUser(Intent, UserHandle, BroadcastReceiver, Handler, Result, String, Bundle)
已淘汰.

版本 #sendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, int, String, Bundle) 這樣你就能指定廣播要傳送給哪個使用者。

SetHandle(IntPtr, JniHandleOwnership)

設定 Handle 屬性。

(繼承來源 Object)
SetTheme(Int32)

為這個情境設定基本主題。

SetWallpaper(Bitmap)
已淘汰.

此會員已被棄用。

SetWallpaper(Stream)
已淘汰.

此會員已被棄用。

StartActivities(Intent[], Bundle)

啟動多項新活動。

StartActivities(Intent[])

就像 #startActivities(Intent[], Bundle) 沒有指定選項一樣。

StartActivity(Intent, Bundle)

啟動一項新活動。

StartActivity(Intent)

就像 #startActivity(Intent, Bundle) 沒有指定選項一樣。

StartActivity(Type)

介面連接全域應用程式環境資訊。

StartForegroundService(Intent)

類似 #startService(Intent)於 ,但隱含承諾服務一旦開始運行就會呼叫 android.app.Service#startForeground(int, android.app.Notification) startForeground(int, android.app.Notification)

StartInstrumentation(ComponentName, String, Bundle)

開始執行一個 android.app.Instrumentation 類別。

StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32, Bundle)

#startActivity(Intent, Bundle)是,但一開始就用一個意圖發送者。

StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32)

就像 #startIntentSender(IntentSender, Intent, int, int, int, Bundle) 沒有指定選項一樣。

StartService(Intent)

請求啟動某項應用程式服務。

StopService(Intent)

請求停止某項應用程式服務。

ToArray<T>()

介面連接全域應用程式環境資訊。

(繼承來源 Object)
ToString()

回傳物件的字串表示。

(繼承來源 Object)
UnbindService(IServiceConnection)

斷開應用程式服務。

UnregisterComponentCallbacks(IComponentCallbacks)

移除 ComponentCallbacks 先前註冊於 #registerComponentCallbacks(ComponentCallbacks)的物件。

UnregisterDeviceIdChangeListener(IIntConsumer)

移除一個裝置 ID,變更了 Context 中的監聽者。

UnregisterFromRuntime()

介面連接全域應用程式環境資訊。

(繼承來源 Object)
UnregisterReceiver(BroadcastReceiver)

取消註冊先前註冊的廣播接收器。

UpdateServiceGroup(IServiceConnection, Int32, Int32)

對於先前綁定於 #bindService 或相關方法的服務,改變系統管理該服務程序與其他程序之間的方式。

Wait()

導致目前執行緒等待被喚醒,通常是透過 <em>通知</><em 或 em>中斷</em> 來喚醒。

(繼承來源 Object)
Wait(Int64, Int32)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)
Wait(Int64)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)

明確介面實作

名稱 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)

取得實例 self類型的 JNI 名稱。

JavaAs<TResult>(IJavaPeerable)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

JavaCast<TResult>(IJavaObject)

執行 Android 執行時檢查型別轉換。

JavaCast<TResult>(IJavaObject)

介面連接全域應用程式環境資訊。

TryJavaCast<TResult>(IJavaPeerable, TResult)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

適用於