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

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

构造函数

名称 说明
Context()
Context(IntPtr, JniHandleOwnership)

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

字段

名称 说明
AccessibilityService

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

AccountService

#getSystemService(String)用于在选择时检索android.accounts.AccountManager用于接收意向的意向。

ActivityService

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

AdvancedProtectionService

用于 #getSystemService(String) 检索 android.security.advancedprotection.AdvancedProtectionManager

AlarmService

#getSystemService(String)用于在选择时检索android.app.AlarmManager用于接收意向的意向。

AppFunctionService

用于 #getSystemService(String) 检索用于执行应用函数的函数 AppFunctionManager

AppOpsService

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

AppSearchService

#getSystemService(String)用于检索android.app.appsearch.AppSearchManager索引和查询由系统管理的应用数据。

AppwidgetService

#getSystemService(String)用于检索用于访问 AppWidgets 的命令android.appwidget.AppWidgetManager

AudioService

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

BatteryService

#getSystemService(String)用于检索用于管理电池状态的 Aandroid.os.BatteryManager

BindAllowActivityStarts
已过时.

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

BindExternalServiceLong

的工作方式与 #BIND_EXTERNAL_SERVICE 相同,但它被定义为 long 与它兼容的 BindServiceFlags值。

BindNotPerceptible
已过时.

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

BindPackageIsolatedProcess
已过时.

标志: #bindIsolatedService将服务绑定到共享隔离进程,但仅与其他隔离服务从声明相同进程名称的同一包中绑定。

BindSharedIsolatedProcess
已过时.

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

BiometricService

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

BlobStoreService

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

BluetoothService

#getSystemService(String)用于检索android.bluetooth.BluetoothManager使用蓝牙的用途。

BugreportService

用于捕获 bug 报告的服务。

CameraService

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

CaptioningService

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

CarrierConfigService

用于 #getSystemService(String) 检索 android.telephony.CarrierConfigManager 读取运营商配置值。

ClipboardService

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

CompanionDeviceService

#getSystemService(String)用于检索android.companion.CompanionDeviceManager用于管理配套设备

ConnectivityDiagnosticsService

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

ConnectivityService

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

ConsumerIrService

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

ContactKeysService

#getSystemService(String)用于检索管理联系人密钥的密钥E2eeContactKeysManager

CredentialService

#getSystemService(String)用于检索用户android.credentials.CredentialManager对应用进行身份验证。

CrossProfileAppsService

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

DeviceIdDefault

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

DeviceIdInvalid

设备 ID 无效。

DeviceLockService

#getSystemService(String)用于检索 android.devicelock.DeviceLockManager.

DevicePolicyService

#getSystemService(String)用于检索用于处理全局设备策略管理的项android.app.admin.DevicePolicyManager

DisplayHashService

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

DisplayService

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

DomainVerificationService

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

DownloadService

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

DropboxService

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

EuiccService

#getSystemService(String)用于检索android.telephony.euicc.EuiccManager用于管理设备 eUICC (嵌入式 SIM) 的设备。

FileIntegrityService

#getSystemService(String)用于检索 android.security.FileIntegrityManager.

FingerprintService

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

GameService

#getSystemService(String)用于检索 GameManager.

GrammaticalInflectionService

#getSystemService(String)用于检索 GrammaticalInflectionManager.

HardwarePropertiesService

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

HealthconnectService

#getSystemService(String)用于检索 android.health.connect.HealthConnectManager.

InputMethodService

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

InputService

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

IpsecService

#getSystemService(String)用于检索android.net.IpSecManager用于使用 IPSec 加密套接字或网络。

JobSchedulerService

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

KeyguardService

#getSystemService(String)用于检索android.app.KeyguardManager用于控制密钥保护的密钥保护。

KeystoreService

用于 #getSystemService(String) 检索用于访问 Android 密钥存储函数的密钥 android.security.keystore.KeyStoreManager 存储函数。

LauncherAppsService

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

LayoutInflaterService

用于 #getSystemService(String) 检索用于在此上下文中膨胀布局资源的引用 android.view.LayoutInflater

LocaleService

#getSystemService(String)用于检索 android.app.LocaleManager.

LocationService

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

MediaCommunicationService

#getSystemService(String)用于检索 android.media.MediaCommunicationManager 用于管理 android.media.MediaSession2

MediaMetricsService

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

MediaProjectionService

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

MediaQualityService

用于 #getSystemService(String) 检索 android.media.quality.MediaQuality 标准化图片和音频 API 参数。

MediaRouterService

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

MediaSessionService

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

MidiService

用于 #getSystemService(String) 检索用于访问 MIDI 服务的 A android.media.midi.MidiManager

NetworkStatsService

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

NfcService

#getSystemService(String)用于检索使用 NFC 的 ANFCandroid.nfc.NfcManager

NotificationService

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

NsdService

用于 #getSystemService(String) 检索 android.net.nsd.NsdManager 用于处理网络服务发现管理

OverlayService

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

PeopleService

#getSystemService(String)用于访问与PeopleManager已发布对话交互的会话。

PerformanceHintService

#getSystemService(String)用于检索android.os.PerformanceHintManager用于访问性能提示服务。

PersistentDataBlockService

#getSystemService(String)用于检索android.service.persistentdata.PersistentDataBlockManager实例,以便与驻留在恢复出厂设置中的存储设备进行交互。

PowerService

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

PrintService

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

ProfilingService

#getSystemService(String)用于检索 android.os.ProfilingManager.

ReceiverExported
已过时.

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

ReceiverNotExported
已过时.

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

ReceiverVisibleToInstantApps
已过时.

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

RestrictionsService

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

RoleService

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

SatelliteService

#getSystemService(String)用于检索android.telephony.satellite.SatelliteManager访问附属功能。

SearchService

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

SecurityStateService

#getSystemService(String)用于检索用于访问安全状态管理器服务的帐户android.os.SecurityStateManager

SensorService

#getSystemService(String)用于检索用于访问传感器的通道android.hardware.SensorManager

ShortcutService

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

StatusBarService

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

StorageService

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

StorageStatsService

#getSystemService(String)用于检索用于访问系统存储统计信息的集合android.app.usage.StorageStatsManager

SystemHealthService

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

TelecomService

#getSystemService(String)用于检索设备android.telecom.TelecomManager与电信相关的功能。

TelephonyImsService

#getSystemService(String)用于检索 android.telephony.ims.ImsManager.

TelephonyService

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

TelephonySubscriptionService

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

TetheringService

用于 #getSystemService(String) 检索用于管理系带函数的函数 android.net.TetheringManager

TextClassificationService

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

TextServicesManagerService

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

TvAdService

#getSystemService(String)用于检索用于在设备上与电视客户端播发服务交互的项android.media.tv.ad.TvAdManager

TvInputService

#getSystemService(String)用于检索用于在设备上与电视输入进行交互的项android.media.tv.TvInputManager

TvInteractiveAppService

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

UiModeService

用于 #getSystemService(String) 检索用于控制 UI 模式的控件 android.app.UiModeManager

UsageStatsService

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

UsbService

用于 #getSystemService(String) 检索 android.hardware.usb.UsbManager 对 USB 设备的访问(作为 USB 主机)以及控制此设备作为 USB 设备的行为。

UserService

用于 #getSystemService(String) 检索用于 android.os.UserManager 管理支持多个用户的设备上的用户。

VibratorManagerService

用于 #getSystemService(String) 检索用于访问设备振动器、与单个振动器交互以及对多个振动器播放同步效果的 a android.os.VibratorManager

VibratorService

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

VirtualDeviceService

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

VpnManagementService

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

WallpaperService

用于 #getSystemService(String) 检索 com。

WifiAwareService

用于 #getSystemService(String) 检索 android.net.wifi.aware.WifiAwareManager 用于处理 Wi-Fi 感知的管理。

WifiP2pService

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

WifiRttRangingService

/a0> 一起使用,使用 wifi 检索范围设备。

WifiService

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

WindowService

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

属性

名称 说明
ApplicationContext

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

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

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

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

返回应用程序的包的资源实例。

Theme

返回与此上下文关联的 Theme 对象。

ThresholdClass

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

ThresholdType

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

Wallpaper
WallpaperDesiredMinimumHeight
WallpaperDesiredMinimumWidth

方法

名称 说明
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)

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

CheckCallingOrSelfPermission(String)

确定 IPC <em>或你</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)

确定 em>you</em> 是否已<被授予特定权限。

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 对象,但将属性返回到其他标记。

CreateConfigurationContext(Configuration)

返回当前上下文的新 Context 对象,但要调整其资源以匹配给定的配置。

CreateContext(ContextParams)

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

CreateContextForSplit(String)

返回给定拆分名称的新 Context 对象。

CreateDeviceContext(Int32)

从当前上下文中返回一个新 对象,但与设备关联由 < a0 /> 提供。

CreateDeviceProtectedStorageContext()

返回当前上下文的新 Context 对象,但其存储 API 由受设备保护的存储提供支持。

CreateDisplayContext(Display)

从当前上下文中返回一个新 Context 对象,但调整了资源以匹配其 display指标。

CreatePackageContext(String, PackageContextFlags)

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

CreateWindowContext(Display, Int32, Bundle)

为给定Display的窗口android.app.Activity activity创建一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)

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

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)

向上下文的基本应用程序添加新内容 ComponentCallbacks ,它将在调用 ActivityCallbacks 方法和其他组件的同一时间调用。

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,或者<删除任何其他</em>> 机制。

SendBroadcast(Intent, String, Bundle)

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

SendBroadcast(Intent, String)

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

SendBroadcast(Intent)

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

SendBroadcastAsUser(Intent, UserHandle, String)

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

SendBroadcastAsUser(Intent, UserHandle)

#sendBroadcast(Intent)该版本允许你指定将发送到该广播的用户。

SendBroadcastWithMultiplePermissions(Intent, String[])

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

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)

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

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

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

SendOrderedBroadcast(Intent, String)

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

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),但要开始一个 IntentSender。

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 更改的侦听器。

UnregisterFromRuntime()

有关应用程序环境的全局信息的接口。

(继承自 Object)
UnregisterReceiver(BroadcastReceiver)

取消注册以前注册的 BroadcastReceiver。

UpdateServiceGroup(IServiceConnection, Int32, Int32)

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

Wait()

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

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

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

(继承自 Object)
Wait(Int64)

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

(继承自 Object)

显式接口实现

名称 说明
IJavaPeerable.Disposed()

有关应用程序环境的全局信息的接口。

(继承自 Object)
IJavaPeerable.DisposeUnlessReferenced()

有关应用程序环境的全局信息的接口。

(继承自 Object)
IJavaPeerable.Finalized()

有关应用程序环境的全局信息的接口。

(继承自 Object)
IJavaPeerable.JniManagedPeerState

有关应用程序环境的全局信息的接口。

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

有关应用程序环境的全局信息的接口。

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

有关应用程序环境的全局信息的接口。

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

有关应用程序环境的全局信息的接口。

(继承自 Object)

扩展方法

名称 说明
GetJniTypeName(IJavaPeerable)

获取实例 self类型的 JNI 名称。

JavaAs<TResult>(IJavaPeerable)

尝试强制self键入TResult,检查强制是否在Java端有效。

JavaCast<TResult>(IJavaObject)

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

JavaCast<TResult>(IJavaObject)

有关应用程序环境的全局信息的接口。

TryJavaCast<TResult>(IJavaPeerable, TResult)

尝试强制self键入TResult,检查强制是否在Java端有效。

适用于