ContextWrapper 类

定义

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

[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
继承
ContextWrapper
派生
属性

注解

上下文的代理实现,它只是将其所有调用委托给另一个 Context。 可以进行子类化以修改行为,而无需更改原始上下文。

android.content.ContextWrapperJava 文档。

此页面的某些部分是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的条款使用。

构造函数

ContextWrapper(Context)
ContextWrapper(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

字段

AccessibilityService

使用 和 #getSystemService(String) 检索 , android.view.accessibility.AccessibilityManager 以便通过已注册的事件侦听器向用户提供 UI 事件反馈。

(继承自 Context)
AccountService

将 与 一起使用 #getSystemService(String)android.accounts.AccountManager 检索 ,以便在选择时接收意向。

(继承自 Context)
ActivityService

使用 和 #getSystemService(String) 检索用于 android.app.ActivityManager 与全局系统状态交互的 。

(继承自 Context)
AlarmService

将 与 一起使用 #getSystemService(String)android.app.AlarmManager 检索 ,以便在选择时接收意向。

(继承自 Context)
AppOpsService

使用 和 #getSystemService(String) 检索 , android.app.AppOpsManager 以跟踪设备上的应用程序操作。

(继承自 Context)
AppSearchService

使用 和 #getSystemService(String) 检索 , android.app.appsearch.AppSearchManager 以便为系统管理的应用数据编制索引和查询。

(继承自 Context)
AppwidgetService

将 与 一起使用 #getSystemService(String) ,检索 android.appwidget.AppWidgetManager 用于访问 AppWidget 的 。

(继承自 Context)
AudioService

使用 和 #getSystemService(String) 检索 , android.media.AudioManager 以处理音量、响铃模式和音频路由的管理。

(继承自 Context)
BatteryService

将 与 一起使用 #getSystemService(String) ,检索 android.os.BatteryManager 用于管理电池状态的 。

(继承自 Context)
BindAllowActivityStarts
已过时.

标志 #bindService:如果从可见的应用绑定,则允许绑定服务从后台启动活动。

(继承自 Context)
BindExternalServiceLong

的工作方式与 相同 #BIND_EXTERNAL_SERVICE,但它被定义为 (

(继承自 Context)
BindNotPerceptible
已过时.

标志 #bindService:如果从可见或用户可感知的应用绑定,请将目标服务的重要性降低到可感知级别以下。

(继承自 Context)
BindSharedIsolatedProcess
已过时.

#bindIsolatedService标志:将服务绑定到共享隔离进程。

(继承自 Context)
BiometricService

将 与 一起使用 #getSystemService(String) ,检索 android.hardware.biometrics.BiometricManager 用于处理生物识别和 PIN/模式/密码身份验证的 。

(继承自 Context)
BlobStoreService

使用 和 #getSystemService(String) 检索 , android.app.blob.BlobStoreManager 以便从系统维护的 Blob 存储中参与和访问数据 Blob。

(继承自 Context)
BluetoothService

使用 与 #getSystemService(String) 检索 , android.bluetooth.BluetoothManager 以使用蓝牙。

(继承自 Context)
BugreportService

用于捕获 bug 报告的服务。

(继承自 Context)
CameraService

使用 和 #getSystemService(String) 检索用于 android.hardware.camera2.CameraManager 与相机设备交互的 。

(继承自 Context)
CaptioningService

使用 与 #getSystemService(String) 一起使用 android.view.accessibility.CaptioningManager ,检索 用于获取字幕属性和侦听字幕首选项的更改。

(继承自 Context)
CarrierConfigService

将 与 一起使用 #getSystemService(String) ,检索 android.telephony.CarrierConfigManager 用于读取运营商配置值的 。

(继承自 Context)
ClipboardService

使用 和 #getSystemService(String) 检索 , android.content.ClipboardManager 以便访问和修改全局剪贴板的内容。

(继承自 Context)
CompanionDeviceService

使用 与 #getSystemService(String) 一起使用,检索 android.companion.CompanionDeviceManager 用于管理配套设备的

(继承自 Context)
ConnectivityDiagnosticsService

使用 和 #getSystemService(String) 检索 ,android.net.ConnectivityDiagnosticsManager以便执行网络连接诊断以及从系统接收网络连接信息。

(继承自 Context)
ConnectivityService

使用 和 #getSystemService(String) 检索用于 android.net.ConnectivityManager 处理网络连接管理的 。

(继承自 Context)
ConsumerIrService

将 与 一起使用 #getSystemService(String) ,检索 android.hardware.ConsumerIrManager 用于从设备传输红外信号的 。

(继承自 Context)
CredentialService

使用 和 #getSystemService(String) 检索 , android.credentials.CredentialManager 以向应用验证用户身份。

(继承自 Context)
CrossProfileAppsService

使用 与 #getSystemService(String) 检索 android.content.pm.CrossProfileApps 跨配置文件操作的 。

(继承自 Context)
DeviceIdDefault

默认设备 ID,即主 (非虚拟) 设备的 ID。

(继承自 Context)
DeviceIdInvalid

设备 ID 无效。

(继承自 Context)
DeviceLockService

将 与 一起使用#getSystemService(String)android.devicelock.DeviceLockManager以检索 。

(继承自 Context)
DevicePolicyService

使用 和 #getSystemService(String) 检索 , android.app.admin.DevicePolicyManager 以使用全局设备策略管理。

(继承自 Context)
DisplayHashService

使用 和 #getSystemService(String) 访问 android.view.displayhash.DisplayHashManager 以处理显示哈希。

(继承自 Context)
DisplayService

使用 和 #getSystemService(String) 检索用于 android.hardware.display.DisplayManager 与显示设备交互的 。

(继承自 Context)
DomainVerificationService

使用 和 #getSystemService(String) 访问 android.content.pm.verify.domain.DomainVerificationManager ,以检索已声明 Web 域的审批和用户状态。

(继承自 Context)
DownloadService

使用 和 #getSystemService(String) 检索 android.app.DownloadManager 用于请求 HTTP 下载的 。

(继承自 Context)
DropboxService

使用 与 #getSystemService(String) 一起使用,检索用于记录诊断日志的 android.os.DropBoxManager 实例。

(继承自 Context)
EuiccService

使用 与 #getSystemService(String) 一起使用 android.telephony.euicc.EuiccManager ,检索 以管理设备 eUICC (嵌入式 SIM 卡) 。

(继承自 Context)
FileIntegrityService

将 与 一起使用 #getSystemService(String) 以检索 android.security.FileIntegrityManager

(继承自 Context)
FingerprintService

使用 和 #getSystemService(String) 检索用于 android.hardware.fingerprint.FingerprintManager 处理指纹管理的 。

(继承自 Context)
GameService

将 与 一起使用#getSystemService(String)GameManager以检索 。

(继承自 Context)
GrammaticalInflectionService

将 与 一起使用#getSystemService(String)GrammaticalInflectionManager以检索 。

(继承自 Context)
HardwarePropertiesService

使用 和 #getSystemService(String) 检索用于 android.os.HardwarePropertiesManager 访问硬件属性服务的 。

(继承自 Context)
HealthconnectService

将 与 一起使用#getSystemService(String)android.health.connect.HealthConnectManager以检索 。

(继承自 Context)
InputMethodService

使用 和 #getSystemService(String) 检索 用于 android.view.inputmethod.InputMethodManager 访问输入法的 。

(继承自 Context)
InputService

使用 和 #getSystemService(String) 检索用于 android.hardware.input.InputManager 与输入设备交互的 。

(继承自 Context)
IpsecService

使用 和 #getSystemService(String) 检索 , android.net.IpSecManager 以使用 IPSec 对套接字或网络进行加密。

(继承自 Context)
JobSchedulerService

使用 和 #getSystemService(String) 检索 android.app.job.JobScheduler 用于管理偶尔后台任务的实例。

(继承自 Context)
KeyguardService

将 与 一起使用 #getSystemService(String) ,检索 android.app.KeyguardManager 用于控制键卫的 。

(继承自 Context)
LauncherAppsService

使用 和 #getSystemService(String) 检索 , android.content.pm.LauncherApps 以便跨用户配置文件查询和监视可启动的应用。

(继承自 Context)
LayoutInflaterService

使用 和 #getSystemService(String) 检索 android.view.LayoutInflater ,以便在此上下文中扩充布局资源。

(继承自 Context)
LocaleService

将 与 一起使用#getSystemService(String)android.app.LocaleManager以检索 。

(继承自 Context)
LocationService

使用 和 #getSystemService(String) 检索 , android.location.LocationManager 以控制位置更新。

(继承自 Context)
MediaCommunicationService

将 与 一起使用 #getSystemService(String) 以检索android.media.MediaCommunicationManager 用于管理 android.media.MediaSession2

(继承自 Context)
MediaMetricsService

使用 和 #getSystemService(String) 检索用于 android.media.metrics.MediaMetricsManager 与设备上的媒体指标交互的 。

(继承自 Context)
MediaProjectionService

使用 和 #getSystemService(String) 检索 android.media.projection.MediaProjectionManager 用于管理媒体投影会话的实例。

(继承自 Context)
MediaRouterService

使用 和 #getSystemService 检索 , android.media.MediaRouter 以控制和管理媒体的路由。

(继承自 Context)
MediaSessionService

使用 和 #getSystemService(String) 检索用于 android.media.session.MediaSessionManager 管理媒体会话的 。

(继承自 Context)
MidiService

将 与 一起使用 #getSystemService(String) ,检索 android.media.midi.MidiManager 用于访问 MIDI 服务的 。

(继承自 Context)
NetworkStatsService

将 与 一起使用 #getSystemService(String) ,检索 android.app.usage.NetworkStatsManager 用于查询网络使用情况统计信息的 。

(继承自 Context)
NfcService

使用 与 #getSystemService(String) 检索 , android.nfc.NfcManager 以使用 NFC。

(继承自 Context)
NotificationService

使用 和 #getSystemService(String) 检索 , android.app.NotificationManager 以通知用户后台事件。

(继承自 Context)
NsdService

将 与 一起使用 #getSystemService(String) ,检索 android.net.nsd.NsdManager 用于处理网络服务发现的管理

(继承自 Context)
OverlayService

使用 和 #getSystemService(String) 检索用于 android.content.om.OverlayManager 管理覆盖包的 。

(继承自 Context)
PeopleService

使用 和 #getSystemService(String) 访问 , PeopleManager 以便与已发布的对话进行交互。

(继承自 Context)
PerformanceHintService

将 与 一起使用 #getSystemService(String) ,检索 android.os.PerformanceHintManager 用于访问性能提示服务的 。

(继承自 Context)
PowerService

使用 和 #getSystemService(String) 检索 android.os.PowerManager 用于控制电源管理的 ,包括“唤醒锁”,使你可以在运行长时间任务时使设备保持打开状态。

(继承自 Context)
PrintService

android.print.PrintManager 用于打印和管理打印机和打印任务。

(继承自 Context)
ReceiverExported
已过时.

标志 #registerReceiver:接收方可以接收来自其他应用的广播。

(继承自 Context)
ReceiverNotExported
已过时.

标志 #registerReceiver:接收方无法接收来自其他应用的广播。

(继承自 Context)
ReceiverVisibleToInstantApps
已过时.

标志 #registerReceiver:接收方可以从即时应用接收广播。

(继承自 Context)
RestrictionsService

使用 和 #getSystemService(String) 检索 , android.content.RestrictionsManager 用于检索应用程序限制和请求受限操作的权限。

(继承自 Context)
RoleService

使用 和 #getSystemService(String) 检索用于 android.app.role.RoleManager 管理角色的 。

(继承自 Context)
SearchService

使用 和 #getSystemService(String) 检索 android.app.SearchManager 用于处理搜索的 。

(继承自 Context)
SensorService

将 与 一起使用 #getSystemService(String) ,检索 android.hardware.SensorManager 用于访问传感器的 。

(继承自 Context)
ShortcutService

使用 和 #getSystemService(String) 检索用于 android.content.pm.ShortcutManager 访问启动器快捷方式服务的 。

(继承自 Context)
StatusBarService

使用 和 #getSystemService(String) 检索用于 android.app.StatusBarManager 与状态栏和快速设置交互的 。

(继承自 Context)
StorageService

使用 和 #getSystemService(String) 检索 用于 android.os.storage.StorageManager 访问系统存储函数的 。

(继承自 Context)
StorageStatsService

将 与 一起使用 #getSystemService(String) ,检索 android.app.usage.StorageStatsManager 用于访问系统存储统计信息的 。

(继承自 Context)
SystemHealthService

使用 和 #getSystemService(String) 检索 android.os.health.SystemHealthManager ,以访问系统运行状况 (电池、电源、内存等) 指标。

(继承自 Context)
TelecomService

使用 和 #getSystemService(String) 检索 , android.telecom.TelecomManager 以管理设备的电信相关功能。

(继承自 Context)
TelephonyImsService

将 与 一起使用 #getSystemService(String) 以检索 android.telephony.ims.ImsManager

(继承自 Context)
TelephonyService

将 与 一起使用 #getSystemService(String) ,检索 android.telephony.TelephonyManager 用于处理设备的电话功能的管理。

(继承自 Context)
TelephonySubscriptionService

将 与 一起使用 #getSystemService(String) ,检索 android.telephony.SubscriptionManager 用于处理设备的电话订阅的管理。

(继承自 Context)
TextClassificationService

将 与 用于 #getSystemService(String) 检索 TextClassificationManager 文本分类服务的 。

(继承自 Context)
TextServicesManagerService

使用 和 #getSystemService(String) 检索 用于 android.view.textservice.TextServicesManager 访问文本服务的 。

(继承自 Context)
TvInputService

使用 和 #getSystemService(String) 检索用于 android.media.tv.TvInputManager 与设备上的电视输入交互的 。

(继承自 Context)
TvInteractiveAppService

使用 和 #getSystemService(String) 检索用于 android.media.tv.interactive.TvInteractiveAppManager 与设备上的电视交互式应用程序交互的 。

(继承自 Context)
UiModeService

将 与 一起使用 #getSystemService(String) ,检索 android.app.UiModeManager 用于控制 UI 模式的 。

(继承自 Context)
UsageStatsService

将 与 一起使用 #getSystemService(String) ,检索 android.app.usage.UsageStatsManager 用于查询设备使用情况统计信息的 。

(继承自 Context)
UsbService

将 与 一起使用 #getSystemService(String) ,检索 android.hardware.usb.UsbManager 对 USB 设备的访问, (作为 USB 主机) ,并用于控制此设备作为 USB 设备的行为。

(继承自 Context)
UserService

使用 和 #getSystemService(String) 检索 , android.os.UserManager 以便在支持多个用户的设备上管理用户。

(继承自 Context)
VibratorManagerService

使用 和 #getSystemService(String) 检索用于 android.os.VibratorManager 访问设备振动器、与单个振动器交互并在多个振动器上播放同步效果的 。

(继承自 Context)
VibratorService

使用 和 #getSystemService(String) 检索用于 android.os.Vibrator 与振动硬件交互的 。

(继承自 Context)
VirtualDeviceService

使用 和 #getSystemService(String) 检索用于 android.companion.virtual.VirtualDeviceManager 管理虚拟设备的 。

(继承自 Context)
VpnManagementService

使用 和 #getSystemService(String) 检索 , android.net.VpnManager 以管理平台内置 VPN 的配置文件。

(继承自 Context)
WallpaperService

使用 与 #getSystemService(String) 检索 com。

(继承自 Context)
WifiAwareService

将 与 一起使用 #getSystemService(String) ,检索 android.net.wifi.aware.WifiAwareManager 用于处理 Wi-Fi Aware 的管理。

(继承自 Context)
WifiP2pService

使用 和 #getSystemService(String) 检索 , android.net.wifi.p2p.WifiP2pManager 以处理 Wi-Fi 对等连接的管理。

(继承自 Context)
WifiRttRangingService

使用 和 #getSystemService(String) 检索 android.net.wifi.rtt.WifiRttManager 具有 wifi 的测距设备的 。

(继承自 Context)
WifiService

使用 和 #getSystemService(String) 检索 , android.net.wifi.WifiManager 以处理 Wi-Fi 访问的管理。

(继承自 Context)
WindowService

使用 和 #getSystemService(String) 检索 android.view.WindowManager 用于访问系统的窗口管理器的 。

(继承自 Context)

属性

ApplicationContext

返回当前进程的单个全局 Application 对象的上下文。

ApplicationInfo

返回此上下文包的完整应用程序信息。

Assets

返回应用程序包的 AssetManager 实例。

AttributionSource

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Context)
AttributionTag

属性可用于复杂应用中,以逻辑方式分隔应用的各个部分。

(继承自 Context)
BaseContext
CacheDir

返回文件系统上特定于应用程序的缓存目录的绝对路径。

Class

返回此 Object的运行时类。

(继承自 Object)
ClassLoader

返回可用于检索此包中的类的类加载程序。

CodeCacheDir

返回专用于存储缓存代码的文件系统上特定于应用程序的缓存目录的绝对路径。

ContentResolver

返回应用程序包的 ContentResolver 实例。

DataDir

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

DeviceId

获取与此上下文关联的设备 ID。

(继承自 Context)
Display

获取与此上下文关联的显示。

(继承自 Context)
ExternalCacheDir

返回主外部文件系统 (上的目录的绝对路径,该目录位于应用程序可以放置其拥有的缓存文件的某个位置 ExternalStorageDirectory

FilesDir

返回文件系统上存储使用 OpenFileOutput(String, FileCreationMode) 创建的文件的目录的绝对路径。

Handle

基础 Android 实例的句柄。

(继承自 Object)
IsDeviceProtectedStorage

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

IsRestricted

指示此上下文是否受到限制。

(继承自 Context)
IsUiContext

true如果上下文是可访问 UI 组件(如 、 或 android.app.WallpaperManager WallpaperManagerWindowManager的 UI 上下文,android.view.LayoutInflater LayoutInflater则返回 。

(继承自 Context)
JniIdentityHashCode

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
JniPeerMembers

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

MainExecutor

返回一个 Executor ,它将在此上下文关联的main线程上运行排队任务。

(继承自 Context)
MainLooper

返回当前进程的main线程的 Looper。

NoBackupFilesDir

返回文件系统上目录的绝对路径,类似于 FilesDir

ObbDir

如果可以找到任何) ,则返回此应用程序的 OBB 文件 (的主外部存储目录。

OpPackageName

返回应该用于 android.app.AppOpsManager 来自此上下文的调用的包名称,以便应用操作管理器的 uid 验证将使用该名称。

(继承自 Context)
PackageCodePath

返回此上下文的主 Android 包的完整路径。

PackageManager

返回 PackageManager 实例以查找全局包信息。

PackageName

返回此应用程序包的名称。

PackageResourcePath

返回此上下文的主 Android 包的完整路径。

Params

返回创建此上下文时使用 的参数集(如果它是通过 #createContext(ContextParams)创建的)。

(继承自 Context)
PeerReference

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
Resources

返回应用程序包的 Resources 实例。

Theme

返回与此 Context 关联的 Theme 对象。

ThresholdClass

此 API 支持 Mono for Android 基础结构,不应直接从代码中使用。

ThresholdType

此 API 支持 Mono for Android 基础结构,不应直接从代码中使用。

Wallpaper
WallpaperDesiredMinimumHeight
WallpaperDesiredMinimumWidth

方法

AttachBaseContext(Context)

设置此 ContextWrapper 的基本上下文。

BindService(Intent, Bind, IExecutor, IServiceConnection)

#bindService(Intent, ServiceConnection, int) bindService(Intent, ServiceConnection, int) 用于控制 ServiceConnection 回调的执行程序相同。

(继承自 Context)
BindService(Intent, Context+BindServiceFlags, IExecutor, IServiceConnection)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Context)
BindService(Intent, IServiceConnection, Bind)

连接到应用程序服务,根据需要创建它。

BindService(Intent, IServiceConnection, Context+BindServiceFlags)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Context)
BindServiceAsUser(Intent, IServiceConnection, Context+BindServiceFlags, UserHandle)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Context)
BindServiceAsUser(Intent, IServiceConnection, Int32, UserHandle)

以与 相同的方式#bindService绑定到给定 user 中的服务。

(继承自 Context)
CheckCallingOrSelfPermission(String)

确定 IPC 的调用进程或 是否被授予了特定权限。

CheckCallingOrSelfUriPermission(Uri, ActivityFlags)

确定 IPC 的调用进程或 是否被授予了访问特定 URI 的权限。

CheckCallingOrSelfUriPermissions(IList<Uri>, Int32)

确定 IPC <或>you</em> 的调用进程是否已被授予访问 URI 列表的权限。

(继承自 Context)
CheckCallingPermission(String)

确定你正在处理的 IPC 的调用进程是否已被授予特定权限。

CheckCallingUriPermission(Uri, ActivityFlags)

确定是否向调用进程和用户 ID 授予了访问特定 URI 的权限。

CheckCallingUriPermissions(IList<Uri>, Int32)

确定是否向调用进程和用户 ID 授予了访问 URI 列表的权限。

(继承自 Context)
CheckPermission(String, Int32, Int32)

确定是否允许对系统中运行的特定进程和用户 ID 使用给定的权限。

CheckSelfPermission(String)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

CheckUriPermission(Uri, Int32, Int32, ActivityFlags)

确定是否向特定进程和用户 ID 授予了访问特定 URI 的权限。

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

检查 URI 和正常权限。

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

确定是否向特定进程和用户 ID 授予了访问 URI 列表的权限。

(继承自 Context)
ClearWallpaper()
Clone()

创建并返回此对象的副本。

(继承自 Object)
CreateAttributionContext(String)

返回当前 Context 的新 Context 对象,但属性为不同的标记。

(继承自 Context)
CreateConfigurationContext(Configuration)

返回当前 Context 的新 Context 对象,但其资源已调整为与给定配置匹配。

CreateContext(ContextParams)

创建具有特定属性和行为的上下文。

(继承自 Context)
CreateContextForSplit(String)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

CreateDeviceContext(Int32)

从当前上下文返回一个新的 Context 对象,但具有 由 deviceId给定的设备关联。

(继承自 Context)
CreateDeviceProtectedStorageContext()

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

CreateDisplayContext(Display)

返回当前 Context 的新 Context 对象,但其资源已调整为与给定 Display 的指标匹配。

CreatePackageContext(String, PackageContextFlags)

返回给定应用程序名称的新 Context 对象。

CreateWindowContext(Display, Int32, Bundle)

Context为给定 Display上的非android.app.Activity activity窗口创建 。

(继承自 Context)
CreateWindowContext(Int32, Bundle)

为非活动窗口创建上下文。

(继承自 Context)
DatabaseList()

返回一个字符串数组,这些字符串命名与此上下文的应用程序包关联的专用数据库。

DeleteDatabase(String)

删除与此上下文的应用程序包关联的现有专用 SQLiteDatabase。

DeleteFile(String)

删除与此上下文的应用程序包关联的给定专用文件。

DeleteSharedPreferences(String)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

Dispose()

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
Dispose(Boolean)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
EnforceCallingOrSelfPermission(String, String)

如果你和正在处理的 IPC 的调用进程都没有被授予特定权限,则 SecurityException引发 。

EnforceCallingOrSelfUriPermission(Uri, ActivityFlags, String)

如果 IPC 的调用进程 或你 尚未被授予访问特定 URI 的权限,则引发 SecurityException

EnforceCallingPermission(String, String)

如果正在处理的 IPC 的调用进程尚未被授予特定权限,则 SecurityException引发 。

EnforceCallingUriPermission(Uri, ActivityFlags, String)

如果尚未向调用进程和用户 ID 授予访问特定 URI 的权限,则引发 SecurityException

EnforcePermission(String, Int32, Int32, String)

如果系统中运行的特定进程和用户 ID 不允许给定的权限,则 SecurityException引发 。

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

如果尚未向特定进程和用户 ID 授予访问特定 URI 的权限,则引发 SecurityException

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

强制实施 URI 和普通权限。

Equals(Object)

指示某个其他对象是否“等于”此对象。

(继承自 Object)
FileList()

返回一个字符串数组,这些字符串命名与此上下文的应用程序包关联的专用文件。

GetColor(Int32)

返回与特定资源 ID 关联的颜色,并为当前主题设置样式。

(继承自 Context)
GetColorStateList(Int32)

返回与特定资源 ID 关联的颜色状态列表,并为当前主题设置样式。

(继承自 Context)
GetDatabasePath(String)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

GetDir(String, FileCreationMode)

检索、根据需要创建一个新目录,应用程序可在其中放置其自己的自定义数据文件。

GetDrawable(Int32)

返回与特定资源 ID 关联的可绘制对象,该对象为当前主题设置样式。

(继承自 Context)
GetExternalCacheDirs()

返回应用程序可在其中放置其拥有的缓存文件的所有外部存储设备上特定于应用程序的目录的绝对路径。

GetExternalFilesDir(String)

返回主外部文件系统 (上的目录的绝对路径,该目录位于 ExternalStorageDirectory) 应用程序可以放置其拥有的永久性文件的位置。

GetExternalFilesDirs(String)

返回所有外部存储设备上特定于应用程序的目录的绝对路径,应用程序可以在这些设备上放置其拥有的永久性文件。

GetExternalMediaDirs()
已过时.

返回应用程序可在其中放置媒体文件的所有外部存储设备上特定于应用程序的目录的绝对路径。

GetFileStreamPath(String)

返回文件系统上存储使用 OpenFileOutput(String, FileCreationMode) 创建的文件的绝对路径。

GetHashCode()

返回对象的哈希代码值。

(继承自 Object)
GetObbDirs()

返回所有外部存储设备上应用程序特定目录的绝对路径,其中应用程序的 OBB 文件 ((如果可以找到任何) )。

GetSharedPreferences(String, FileCreationMode)

检索并保存首选项文件“name”的内容,并返回一个 SharedPreferences,通过该文件可以检索和修改其值。

GetString(Int32)

从应用程序包的默认字符串表中返回本地化的字符串。

(继承自 Context)
GetString(Int32, Object[])

从应用程序包的默认字符串表中返回本地化的字符串。

(继承自 Context)
GetSystemService(Class)

按类返回系统级服务的句柄。

(继承自 Context)
GetSystemService(String)

按名称返回系统级服务的句柄。

GetSystemServiceName(Class)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

GetText(Int32)

从应用程序包的默认字符串表中返回带样式的本地化 CharSequence。

(继承自 Context)
GetTextFormatted(Int32)

从应用程序包的默认字符串表中返回带样式的本地化 CharSequence。

(继承自 Context)
GrantUriPermission(String, Uri, ActivityFlags)

向另一个包授予访问特定 URI 的权限,无论该包是否具有访问 Uri 内容提供程序的常规权限。

JavaFinalize()

当垃圾回收确定不再引用对象时,由垃圾回收器对对象调用。

(继承自 Object)
MoveDatabaseFrom(Context, String)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

MoveSharedPreferencesFrom(Context, String)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

Notify()

唤醒正在等待此对象的监视器的单个线程。

(继承自 Object)
NotifyAll()

唤醒正在等待此对象的监视器的所有线程。

(继承自 Object)
ObtainStyledAttributes(IAttributeSet, Int32[])

检索此上下文主题中的带样式的属性信息。

(继承自 Context)
ObtainStyledAttributes(IAttributeSet, Int32[], Int32, Int32)

检索此上下文主题中的带样式的属性信息。

(继承自 Context)
ObtainStyledAttributes(Int32, Int32[])

检索此上下文主题中的带样式的属性信息。

(继承自 Context)
ObtainStyledAttributes(Int32[])

检索此上下文主题中的带样式的属性信息。

(继承自 Context)
OpenFileInput(String)

打开与此上下文的应用程序包关联的专用文件进行读取。

OpenFileOutput(String, FileCreationMode)

打开与此上下文的应用程序包关联的专用文件进行写入。

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory)

打开与此上下文的应用程序包关联的新专用 SQLiteDatabase。

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

打开与此上下文的应用程序包关联的新专用 SQLiteDatabase。

PeekWallpaper()
RegisterComponentCallbacks(IComponentCallbacks)

向 Context 的基本应用程序添加一个新的 ComponentCallbacks ,它将在调用活动的 ComponentCallbacks 方法和其他组件的同时调用。

(继承自 Context)
RegisterDeviceIdChangeListener(IExecutor, IIntConsumer)

将新的设备 ID 更改侦听器添加到 Context,系统更改设备关联时将调用该侦听器。

(继承自 Context)
RegisterReceiver(BroadcastReceiver, IntentFilter)

注册一个 BroadcastReceiver,以在main活动线程中运行。

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags)
已过时.

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

RegisterReceiver(BroadcastReceiver, IntentFilter, ReceiverFlags)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Context)
RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler)

注册以接收意向广播,以在计划程序上下文中运行。

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags)
已过时.

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

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

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Context)
RemoveStickyBroadcast(Intent)
RemoveStickyBroadcastAsUser(Intent, UserHandle)
RevokeSelfPermissionOnKill(String)

触发运行时权限的异步吊销。

(继承自 Context)
RevokeSelfPermissionsOnKill(ICollection<String>)

触发对调用包的一个或多个权限的吊销。

(继承自 Context)
RevokeUriPermission(String, Uri, ActivityFlags)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

RevokeUriPermission(Uri, ActivityFlags)

删除之前使用 M:Android.Content.Context.GrantUriPermission (System.String、Android.Net.Uri、Android.Net.Uri) 添加的特定内容提供程序 URI 的所有权限。

SendBroadcast(Intent)

向所有感兴趣的 BroadcastReceivers 广播给定意向。

SendBroadcast(Intent, String)

向所有感兴趣的 BroadcastReceivers 广播给定意向,从而允许强制实施可选的必需权限。

SendBroadcast(Intent, String, Bundle)

向所有感兴趣的 BroadcastReceivers 广播给定意向,从而允许强制实施可选的必需权限。

(继承自 Context)
SendBroadcastAsUser(Intent, UserHandle)

SendBroadcast(Intent)允许指定将广播发送到的用户的版本。

SendBroadcastAsUser(Intent, UserHandle, String)

SendBroadcast(Intent, String)允许指定将广播发送到的用户的版本。

SendBroadcastWithMultiplePermissions(Intent, String[])

向所有感兴趣的 BroadcastReceivers 广播给定意向,从而允许强制实施所需的权限数组。

(继承自 Context)
SendOrderedBroadcast(Intent, Int32, String, String, BroadcastReceiver, Handler, String, Bundle, Bundle)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

SendOrderedBroadcast(Intent, String)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

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

SendBroadcast(Intent)允许从广播中接收回数据的 版本。

SendOrderedBroadcast(Intent, String, Bundle)

向所有感兴趣的 BroadcastReceiver 广播给定意向,一次传送一个,以允许更多首选接收器在将广播传送到不太首选的接收方之前使用广播。

(继承自 Context)
SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle)

#sendBroadcast(Intent)允许从广播中接收回数据的 版本。

(继承自 Context)
SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle)

#sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle)允许你指定应用操作以强制限制广播将发送到哪些接收方的版本。

(继承自 Context)
SendOrderedBroadcastAsUser(Intent, UserHandle, String, BroadcastReceiver, Handler, Result, String, Bundle)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

SendStickyBroadcast(Intent)
已过时.

执行“ #sendBroadcast(Intent) 粘滞”的 ,这意味着你发送的意向在广播完成后会保留,以便其他人可以通过 的 #registerReceiver(BroadcastReceiver, IntentFilter)返回值快速检索该数据。

SendStickyBroadcast(Intent, Bundle)

执行“ #sendBroadcast(Intent) 粘滞”的 ,这意味着你发送的意向在广播完成后会保留,以便其他人可以通过 的 #registerReceiver(BroadcastReceiver, IntentFilter)返回值快速检索该数据。

(继承自 Context)
SendStickyBroadcastAsUser(Intent, UserHandle)
SendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, Result, String, Bundle)
SendStickyOrderedBroadcastAsUser(Intent, UserHandle, BroadcastReceiver, Handler, Result, String, Bundle)
SetHandle(IntPtr, JniHandleOwnership)

设置 Handle 属性。

(继承自 Object)
SetTheme(Int32)

设置此上下文的基本主题。

SetWallpaper(Bitmap)
SetWallpaper(Stream)
StartActivities(Intent[])

StartActivities(Intent[], Bundle) 相同,未指定任何选项。

StartActivities(Intent[], Bundle)

启动多个新活动。

StartActivity(Intent)

StartActivity(Intent, Bundle) 相同,未指定任何选项。

StartActivity(Intent, Bundle)

启动新活动。

StartActivity(Type)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Context)
StartForegroundService(Intent)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

StartInstrumentation(ComponentName, String, Bundle)

开始执行类 Instrumentation

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

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

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

例如 StartActivity(Intent, Bundle),但先使用 IntentSender。

StartService(Intent)

请求启动给定的应用程序服务。

StopService(Intent)

请求停止给定的应用程序服务。

ToArray<T>()

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
ToString()

返回对象的字符串表示形式。

(继承自 Object)
UnbindService(IServiceConnection)

断开与应用程序服务的连接。

UnregisterComponentCallbacks(IComponentCallbacks)

ComponentCallbacks删除以前向 注册#registerComponentCallbacks(ComponentCallbacks)的 对象。

(继承自 Context)
UnregisterDeviceIdChangeListener(IIntConsumer)

从上下文中删除设备 ID 更改的侦听器。

(继承自 Context)
UnregisterFromRuntime()

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
UnregisterReceiver(BroadcastReceiver)

取消注册以前注册的 BroadcastReceiver。

UpdateServiceGroup(IServiceConnection, Int32, Int32)

对于以前与 #bindService 或相关方法绑定的服务,更改系统管理该服务进程的方式(相对于其他进程)。

(继承自 Context)
Wait()

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>。<>

(继承自 Object)
Wait(Int64)

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>,或直到经过一定数量的实时。<>

(继承自 Object)
Wait(Int64, Int32)

导致当前线程等待,直到它被唤醒,通常是通过 em <通知/em> 或 <em>interrupted</em>,或直到经过一定数量的实时。<>

(继承自 Object)

显式接口实现

IJavaPeerable.Disposed()

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
IJavaPeerable.DisposeUnlessReferenced()

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
IJavaPeerable.Finalized()

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
IJavaPeerable.JniManagedPeerState

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
IJavaPeerable.SetJniIdentityHashCode(Int32)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)
IJavaPeerable.SetPeerReference(JniObjectReference)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

(继承自 Object)

扩展方法

JavaCast<TResult>(IJavaObject)

执行 Android 运行时检查的类型转换。

JavaCast<TResult>(IJavaObject)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

GetJniTypeName(IJavaPeerable)

上下文的代理实现,它只是将其所有调用委托给另一个 Context。

适用于