共用方式為


Context Class

Definition

Interface to global information about an application environment.

[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
Inheritance
Context
Derived
Attributes

Remarks

Interface to global information about an application environment. This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc.

Java documentation for android.content.Context.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Context()
Context(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

AccessibilityService

Use with #getSystemService(String) to retrieve a android.view.accessibility.AccessibilityManager for giving the user feedback for UI events through the registered event listeners.

AccountService

Use with #getSystemService(String) to retrieve a android.accounts.AccountManager for receiving intents at a time of your choosing.

ActivityService

Use with #getSystemService(String) to retrieve a android.app.ActivityManager for interacting with the global system state.

AlarmService

Use with #getSystemService(String) to retrieve a android.app.AlarmManager for receiving intents at a time of your choosing.

AppOpsService

Use with #getSystemService(String) to retrieve a android.app.AppOpsManager for tracking application operations on the device.

AppSearchService

Use with #getSystemService(String) to retrieve an android.app.appsearch.AppSearchManager for indexing and querying app data managed by the system.

AppwidgetService

Use with #getSystemService(String) to retrieve a android.appwidget.AppWidgetManager for accessing AppWidgets.

AudioService

Use with #getSystemService(String) to retrieve a android.media.AudioManager for handling management of volume, ringer modes and audio routing.

BatteryService

Use with #getSystemService(String) to retrieve a android.os.BatteryManager for managing battery state.

BindAllowActivityStarts
Obsolete.

Flag for #bindService: If binding from an app that is visible, the bound service is allowed to start an activity from background.

BindExternalServiceLong

Works in the same way as #BIND_EXTERNAL_SERVICE, but it's defined as a (

BindNotPerceptible
Obsolete.

Flag for #bindService: If binding from an app that is visible or user-perceptible, lower the target service's importance to below the perceptible level.

BindSharedIsolatedProcess
Obsolete.

Flag for #bindIsolatedService: Bind the service into a shared isolated process.

BiometricService

Use with #getSystemService(String) to retrieve a android.hardware.biometrics.BiometricManager for handling biometric and PIN/pattern/password authentication.

BlobStoreService

Use with #getSystemService(String) to retrieve a android.app.blob.BlobStoreManager for contributing and accessing data blobs from the blob store maintained by the system.

BluetoothService

Use with #getSystemService(String) to retrieve a android.bluetooth.BluetoothManager for using Bluetooth.

BugreportService

Service to capture a bugreport.

CameraService

Use with #getSystemService(String) to retrieve a android.hardware.camera2.CameraManager for interacting with camera devices.

CaptioningService

Use with #getSystemService(String) to retrieve a android.view.accessibility.CaptioningManager for obtaining captioning properties and listening for changes in captioning preferences.

CarrierConfigService

Use with #getSystemService(String) to retrieve a android.telephony.CarrierConfigManager for reading carrier configuration values.

ClipboardService

Use with #getSystemService(String) to retrieve a android.content.ClipboardManager for accessing and modifying the contents of the global clipboard.

CompanionDeviceService

Use with #getSystemService(String) to retrieve a android.companion.CompanionDeviceManager for managing companion devices

ConnectivityDiagnosticsService

Use with #getSystemService(String) to retrieve a android.net.ConnectivityDiagnosticsManager for performing network connectivity diagnostics as well as receiving network connectivity information from the system.

ConnectivityService

Use with #getSystemService(String) to retrieve a android.net.ConnectivityManager for handling management of network connections.

ConsumerIrService

Use with #getSystemService(String) to retrieve a android.hardware.ConsumerIrManager for transmitting infrared signals from the device.

CredentialService

Use with #getSystemService(String) to retrieve a android.credentials.CredentialManager to authenticate a user to your app.

CrossProfileAppsService

Use with #getSystemService(String) to retrieve a android.content.pm.CrossProfileApps for cross profile operations.

DeviceIdDefault

The default device ID, which is the ID of the primary (non-virtual) device.

DeviceIdInvalid

Invalid device ID.

DeviceLockService

Use with #getSystemService(String) to retrieve a android.devicelock.DeviceLockManager.

DevicePolicyService

Use with #getSystemService(String) to retrieve a android.app.admin.DevicePolicyManager for working with global device policy management.

DisplayHashService

Use with #getSystemService(String) to access android.view.displayhash.DisplayHashManager to handle display hashes.

DisplayService

Use with #getSystemService(String) to retrieve a android.hardware.display.DisplayManager for interacting with display devices.

DomainVerificationService

Use with #getSystemService(String) to access android.content.pm.verify.domain.DomainVerificationManager to retrieve approval and user state for declared web domains.

DownloadService

Use with #getSystemService(String) to retrieve a android.app.DownloadManager for requesting HTTP downloads.

DropboxService

Use with #getSystemService(String) to retrieve a android.os.DropBoxManager instance for recording diagnostic logs.

EuiccService

Use with #getSystemService(String) to retrieve a android.telephony.euicc.EuiccManager to manage the device eUICC (embedded SIM).

FileIntegrityService

Use with #getSystemService(String) to retrieve an android.security.FileIntegrityManager.

FingerprintService

Use with #getSystemService(String) to retrieve a android.hardware.fingerprint.FingerprintManager for handling management of fingerprints.

GameService

Use with #getSystemService(String) to retrieve a GameManager.

GrammaticalInflectionService

Use with #getSystemService(String) to retrieve a GrammaticalInflectionManager.

HardwarePropertiesService

Use with #getSystemService(String) to retrieve a android.os.HardwarePropertiesManager for accessing the hardware properties service.

HealthconnectService

Use with #getSystemService(String) to retrieve a android.health.connect.HealthConnectManager.

InputMethodService

Use with #getSystemService(String) to retrieve a android.view.inputmethod.InputMethodManager for accessing input methods.

InputService

Use with #getSystemService(String) to retrieve a android.hardware.input.InputManager for interacting with input devices.

IpsecService

Use with #getSystemService(String) to retrieve a android.net.IpSecManager for encrypting Sockets or Networks with IPSec.

JobSchedulerService

Use with #getSystemService(String) to retrieve a android.app.job.JobScheduler instance for managing occasional background tasks.

KeyguardService

Use with #getSystemService(String) to retrieve a android.app.KeyguardManager for controlling keyguard.

LauncherAppsService

Use with #getSystemService(String) to retrieve a android.content.pm.LauncherApps for querying and monitoring launchable apps across profiles of a user.

LayoutInflaterService

Use with #getSystemService(String) to retrieve a android.view.LayoutInflater for inflating layout resources in this context.

LocaleService

Use with #getSystemService(String) to retrieve a android.app.LocaleManager.

LocationService

Use with #getSystemService(String) to retrieve a android.location.LocationManager for controlling location updates.

MediaCommunicationService

Use with #getSystemService(String) to retrieve a android.media.MediaCommunicationManager for managing android.media.MediaSession2.

MediaMetricsService

Use with #getSystemService(String) to retrieve a android.media.metrics.MediaMetricsManager for interacting with media metrics on the device.

MediaProjectionService

Use with #getSystemService(String) to retrieve a android.media.projection.MediaProjectionManager instance for managing media projection sessions.

MediaRouterService

Use with #getSystemService to retrieve a android.media.MediaRouter for controlling and managing routing of media.

MediaSessionService

Use with #getSystemService(String) to retrieve a android.media.session.MediaSessionManager for managing media Sessions.

MidiService

Use with #getSystemService(String) to retrieve a android.media.midi.MidiManager for accessing the MIDI service.

NetworkStatsService

Use with #getSystemService(String) to retrieve a android.app.usage.NetworkStatsManager for querying network usage stats.

NfcService

Use with #getSystemService(String) to retrieve a android.nfc.NfcManager for using NFC.

NotificationService

Use with #getSystemService(String) to retrieve a android.app.NotificationManager for informing the user of background events.

NsdService

Use with #getSystemService(String) to retrieve a android.net.nsd.NsdManager for handling management of network service discovery

OverlayService

Use with #getSystemService(String) to retrieve a android.content.om.OverlayManager for managing overlay packages.

PeopleService

Use with #getSystemService(String) to access a PeopleManager to interact with your published conversations.

PerformanceHintService

Use with #getSystemService(String) to retrieve a android.os.PerformanceHintManager for accessing the performance hinting service.

PowerService

Use with #getSystemService(String) to retrieve a android.os.PowerManager for controlling power management, including "wake locks," which let you keep the device on while you're running long tasks.

PrintService

android.print.PrintManager for printing and managing printers and print tasks.

ReceiverExported
Obsolete.

Flag for #registerReceiver: The receiver can receive broadcasts from other Apps.

ReceiverNotExported
Obsolete.

Flag for #registerReceiver: The receiver cannot receive broadcasts from other Apps.

ReceiverVisibleToInstantApps
Obsolete.

Flag for #registerReceiver: The receiver can receive broadcasts from Instant Apps.

RestrictionsService

Use with #getSystemService(String) to retrieve a android.content.RestrictionsManager for retrieving application restrictions and requesting permissions for restricted operations.

RoleService

Use with #getSystemService(String) to retrieve a android.app.role.RoleManager for managing roles.

SearchService

Use with #getSystemService(String) to retrieve a android.app.SearchManager for handling searches.

SensorService

Use with #getSystemService(String) to retrieve a android.hardware.SensorManager for accessing sensors.

ShortcutService

Use with #getSystemService(String) to retrieve a android.content.pm.ShortcutManager for accessing the launcher shortcut service.

StatusBarService

Use with #getSystemService(String) to retrieve a android.app.StatusBarManager for interacting with the status bar and quick settings.

StorageService

Use with #getSystemService(String) to retrieve a android.os.storage.StorageManager for accessing system storage functions.

StorageStatsService

Use with #getSystemService(String) to retrieve a android.app.usage.StorageStatsManager for accessing system storage statistics.

SystemHealthService

Use with #getSystemService(String) to retrieve a android.os.health.SystemHealthManager for accessing system health (battery, power, memory, etc) metrics.

TelecomService

Use with #getSystemService(String) to retrieve a android.telecom.TelecomManager to manage telecom-related features of the device.

TelephonyImsService

Use with #getSystemService(String) to retrieve an android.telephony.ims.ImsManager.

TelephonyService

Use with #getSystemService(String) to retrieve a android.telephony.TelephonyManager for handling management the telephony features of the device.

TelephonySubscriptionService

Use with #getSystemService(String) to retrieve a android.telephony.SubscriptionManager for handling management the telephony subscriptions of the device.

TextClassificationService

Use with #getSystemService(String) to retrieve a TextClassificationManager for text classification services.

TextServicesManagerService

Use with #getSystemService(String) to retrieve a android.view.textservice.TextServicesManager for accessing text services.

TvInputService

Use with #getSystemService(String) to retrieve a android.media.tv.TvInputManager for interacting with TV inputs on the device.

TvInteractiveAppService

Use with #getSystemService(String) to retrieve a android.media.tv.interactive.TvInteractiveAppManager for interacting with TV interactive applications on the device.

UiModeService

Use with #getSystemService(String) to retrieve a android.app.UiModeManager for controlling UI modes.

UsageStatsService

Use with #getSystemService(String) to retrieve a android.app.usage.UsageStatsManager for querying device usage stats.

UsbService

Use with #getSystemService(String) to retrieve a android.hardware.usb.UsbManager for access to USB devices (as a USB host) and for controlling this device's behavior as a USB device.

UserService

Use with #getSystemService(String) to retrieve a android.os.UserManager for managing users on devices that support multiple users.

VibratorManagerService

Use with #getSystemService(String) to retrieve a android.os.VibratorManager for accessing the device vibrators, interacting with individual ones and playing synchronized effects on multiple vibrators.

VibratorService

Use with #getSystemService(String) to retrieve a android.os.Vibrator for interacting with the vibration hardware.

VirtualDeviceService

Use with #getSystemService(String) to retrieve a android.companion.virtual.VirtualDeviceManager for managing virtual devices.

VpnManagementService

Use with #getSystemService(String) to retrieve a android.net.VpnManager to manage profiles for the platform built-in VPN.

WallpaperService

Use with #getSystemService(String) to retrieve a com.

WifiAwareService

Use with #getSystemService(String) to retrieve a android.net.wifi.aware.WifiAwareManager for handling management of Wi-Fi Aware.

WifiP2pService

Use with #getSystemService(String) to retrieve a android.net.wifi.p2p.WifiP2pManager for handling management of Wi-Fi peer-to-peer connections.

WifiRttRangingService

Use with #getSystemService(String) to retrieve a android.net.wifi.rtt.WifiRttManager for ranging devices with wifi.

WifiService

Use with #getSystemService(String) to retrieve a android.net.wifi.WifiManager for handling management of Wi-Fi access.

WindowService

Use with #getSystemService(String) to retrieve a android.view.WindowManager for accessing the system's window manager.

Properties

ApplicationContext

Return the context of the single, global Application object of the current process.

ApplicationInfo

Return the full application info for this context's package.

Assets

Return an AssetManager instance for your application's package.

AttributionSource
AttributionTag

Attribution can be used in complex apps to logically separate parts of the app.

CacheDir

Returns the absolute path to the application specific cache directory on the filesystem.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ClassLoader

Return a class loader you can use to retrieve classes in this package.

CodeCacheDir

Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code.

ContentResolver

Return a ContentResolver instance for your application's package.

DataDir
DeviceId

Gets the device ID this context is associated with.

Display

Get the display this context is associated with.

ExternalCacheDir

Returns the absolute path to the directory on the primary external filesystem (that is somewhere on ExternalStorageDirectory where the application can place cache files it owns.

FilesDir

Returns the absolute path to the directory on the filesystem where files created with OpenFileOutput(String, FileCreationMode) are stored.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsDeviceProtectedStorage
IsRestricted

Indicates whether this Context is restricted.

IsUiContext

Returns true if the context is a UI context which can access UI components such as WindowManager, android.view.LayoutInflater LayoutInflater or android.app.WallpaperManager WallpaperManager.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
MainExecutor

Return an Executor that will run enqueued tasks on the main thread associated with this context.

MainLooper

Return the Looper for the main thread of the current process.

NoBackupFilesDir

Returns the absolute path to the directory on the filesystem similar to FilesDir.

ObbDir

Return the primary external storage directory where this application's OBB files (if there are any) can be found.

OpPackageName

Return the package name that should be used for android.app.AppOpsManager calls from this context, so that app ops manager's uid verification will work with the name.

PackageCodePath

Return the full path to this context's primary Android package.

PackageManager

Return PackageManager instance to find global package information.

PackageName

Return the name of this application's package.

PackageResourcePath

Return the full path to this context's primary Android package.

Params

Return the set of parameters which this Context was created with, if it was created via #createContext(ContextParams).

PeerReference (Inherited from Object)
Resources

Return a Resources instance for your application's package.

Theme

Return the Theme object associated with this Context.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Wallpaper
WallpaperDesiredMinimumHeight
WallpaperDesiredMinimumWidth

Methods

BindService(Intent, Bind, IExecutor, IServiceConnection)

Same as #bindService(Intent, ServiceConnection, int) bindService(Intent, ServiceConnection, int) with executor to control ServiceConnection callbacks.

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

Connects to an application service, creating it if needed.

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

Binds to a service in the given user in the same manner as #bindService.

CheckCallingOrSelfPermission(String)

Determine whether the calling process of an IPC <em>or you</em> have been granted a particular permission.

CheckCallingOrSelfUriPermission(Uri, ActivityFlags)

Determine whether the calling process of an IPC <em>or you</em> has been granted permission to access a specific URI.

CheckCallingOrSelfUriPermissions(IList<Uri>, Int32)

Determine whether the calling process of an IPC <em>or you</em> has been granted permission to access a list of URIs.

CheckCallingPermission(String)

Determine whether the calling process of an IPC you are handling has been granted a particular permission.

CheckCallingUriPermission(Uri, ActivityFlags)

Determine whether the calling process and user ID has been granted permission to access a specific URI.

CheckCallingUriPermissions(IList<Uri>, Int32)

Determine whether the calling process and user ID has been granted permission to access a list of URIs.

CheckPermission(String, Int32, Int32)

Determine whether the given permission is allowed for a particular process and user ID running in the system.

CheckSelfPermission(String)

Determine whether <em>you</em> have been granted a particular permission.

CheckUriPermission(Uri, Int32, Int32, ActivityFlags)

Determine whether a particular process and user ID has been granted permission to access a specific URI.

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

Check both a Uri and normal permission.

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

Determine whether a particular process and user ID has been granted permission to access a list of URIs.

ClearWallpaper()
Obsolete.

This member is deprecated.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CreateAttributionContext(String)

Return a new Context object for the current Context but attribute to a different tag.

CreateConfigurationContext(Configuration)

Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration.

CreateContext(ContextParams)

Creates a context with specific properties and behaviors.

CreateContextForSplit(String)

Return a new Context object for the given split name.

CreateDeviceContext(Int32)

Returns a new Context object from the current context but with device association given by the deviceId.

CreateDeviceProtectedStorageContext()

Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage.

CreateDisplayContext(Display)

Returns a new Context object from the current context but with resources adjusted to match the metrics of display.

CreatePackageContext(String, PackageContextFlags)

Return a new Context object for the given application name.

CreateWindowContext(Display, Int32, Bundle)

Creates a Context for a non-android.app.Activity activity window on the given Display.

CreateWindowContext(Int32, Bundle)

Creates a Context for a non-activity window.

DatabaseList()

Returns an array of strings naming the private databases associated with this Context's application package.

DeleteDatabase(String)

Delete an existing private SQLiteDatabase associated with this Context's application package.

DeleteFile(String)

Delete the given private file associated with this Context's application package.

DeleteSharedPreferences(String)

Delete an existing shared preferences file.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
EnforceCallingOrSelfPermission(String, String)

If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a SecurityException.

EnforceCallingOrSelfUriPermission(Uri, ActivityFlags, String)

If the calling process of an IPC <em>or you</em> has not been granted permission to access a specific URI, throw SecurityException.

EnforceCallingPermission(String, String)

If the calling process of an IPC you are handling has not been granted a particular permission, throw a SecurityException.

EnforceCallingUriPermission(Uri, ActivityFlags, String)

If the calling process and user ID has not been granted permission to access a specific URI, throw SecurityException.

EnforcePermission(String, Int32, Int32, String)

If the given permission is not allowed for a particular process and user ID running in the system, throw a SecurityException.

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

If a particular process and user ID has not been granted permission to access a specific URI, throw SecurityException.

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

Enforce both a Uri and normal permission.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FileList()

Returns an array of strings naming the private files associated with this Context's application package.

GetColor(Int32)

Returns a color associated with a particular resource ID and styled for the current theme.

GetColorStateList(Int32)

Returns a color state list associated with a particular resource ID and styled for the current theme.

GetDatabasePath(String)

Returns the absolute path on the filesystem where a database created with #openOrCreateDatabase is stored.

GetDir(String, FileCreationMode)

Retrieve, creating if needed, a new directory in which the application can place its own custom data files.

GetDrawable(Int32)

Returns a drawable object associated with a particular resource ID and styled for the current theme.

GetExternalCacheDirs()

Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place cache files it owns.

GetExternalFilesDir(String)

Returns the absolute path to the directory on the primary shared/external storage device where the application can place persistent files it owns.

GetExternalFilesDirs(String)

Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place persistent files it owns.

GetExternalMediaDirs()

Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place media files.

GetFileStreamPath(String)

Returns the absolute path on the filesystem where a file created with #openFileOutput is stored.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetObbDirs()

Returns absolute paths to application-specific directories on all shared/external storage devices where the application's OBB files (if there are any) can be found.

GetSharedPreferences(String, FileCreationMode)

Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values.

GetString(Int32, Object[])

Returns a localized string from the application's package's default string table.

GetString(Int32)

Returns a localized string from the application's package's default string table.

GetSystemService(Class)

Return the handle to a system-level service by class.

GetSystemService(String)

Return the handle to a system-level service by name.

GetSystemServiceName(Class)

Gets the name of the system-level service that is represented by the specified class.

GetText(Int32)

Return a localized, styled CharSequence from the application's package's default string table.

GetTextFormatted(Int32)

Return a localized, styled CharSequence from the application's package's default string table.

GrantUriPermission(String, Uri, ActivityFlags)

Grant permission to access a specific Uri to another package, regardless of whether that package has general permission to access the Uri's content provider.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
MoveDatabaseFrom(Context, String)

Move an existing database file from the given source storage context to this context.

MoveSharedPreferencesFrom(Context, String)

Move an existing shared preferences file from the given source storage context to this context.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
ObtainStyledAttributes(IAttributeSet, Int32[], Int32, Int32)

Retrieve styled attribute information in this Context's theme.

ObtainStyledAttributes(IAttributeSet, Int32[])

Retrieve styled attribute information in this Context's theme.

ObtainStyledAttributes(Int32, Int32[])

Retrieve styled attribute information in this Context's theme.

ObtainStyledAttributes(Int32[])

Retrieve styled attribute information in this Context's theme.

OpenFileInput(String)

Open a private file associated with this Context's application package for reading.

OpenFileOutput(String, FileCreationMode)

Open a private file associated with this Context's application package for writing.

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

Open a new private SQLiteDatabase associated with this Context's application package.

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory)

Open a new private SQLiteDatabase associated with this Context's application package.

PeekWallpaper()
Obsolete.

This member is deprecated.

RegisterComponentCallbacks(IComponentCallbacks)

Add a new ComponentCallbacks to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called.

RegisterDeviceIdChangeListener(IExecutor, IIntConsumer)

Adds a new device ID changed listener to the Context, which will be called when the device association is changed by the system.

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags)
Obsolete.

Register to receive intent broadcasts, with the receiver optionally being exposed to Instant Apps.

RegisterReceiver(BroadcastReceiver, IntentFilter, ReceiverFlags)
RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags)
Obsolete.

Register to receive intent broadcasts, to run in the context of <var>scheduler</var>.

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

Register to receive intent broadcasts, to run in the context of <var>scheduler</var>.

RegisterReceiver(BroadcastReceiver, IntentFilter)

Register a BroadcastReceiver to be run in the main activity thread.

RemoveStickyBroadcast(Intent)
Obsolete.

Remove the data previously sent with #sendStickyBroadcast, so that it is as if the sticky broadcast had never happened.

RemoveStickyBroadcastAsUser(Intent, UserHandle)
Obsolete.

Version of #removeStickyBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.

RevokeSelfPermissionOnKill(String)

Triggers the asynchronous revocation of a runtime permission.

RevokeSelfPermissionsOnKill(ICollection<String>)

Triggers the revocation of one or more permissions for the calling package.

RevokeUriPermission(String, Uri, ActivityFlags)

Remove permissions to access a particular content provider Uri that were previously added with #grantUriPermission for a specific target package.

RevokeUriPermission(Uri, ActivityFlags)

Remove all permissions to access a particular content provider Uri that were previously added with #grantUriPermission or <em>any other</em> mechanism.

SendBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

SendBroadcast(Intent, String)

Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.

SendBroadcast(Intent)

Broadcast the given intent to all interested BroadcastReceivers.

SendBroadcastAsUser(Intent, UserHandle, String)

Version of #sendBroadcast(Intent, String) that allows you to specify the user the broadcast will be sent to.

SendBroadcastAsUser(Intent, UserHandle)

Version of #sendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.

SendBroadcastWithMultiplePermissions(Intent, String[])

Broadcast the given intent to all interested BroadcastReceivers, allowing an array of required permissions to be enforced.

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

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast.

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

Version of #sendBroadcast(Intent) that allows you to receive data back from the broadcast.

SendOrderedBroadcast(Intent, String, Bundle)

Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers.

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

Version of #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to.

SendOrderedBroadcast(Intent, String)

Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers.

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

Version of #sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the user the broadcast will be sent to.

SendStickyBroadcast(Intent, Bundle)

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter).

SendStickyBroadcast(Intent)
Obsolete.

Perform a #sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of #registerReceiver(BroadcastReceiver, IntentFilter).

SendStickyBroadcastAsUser(Intent, UserHandle)
Obsolete.

Version of #sendStickyBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.

SendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, Result, String, Bundle)
Obsolete.

Version of #sendStickyBroadcast that allows you to receive data back from the broadcast.

SendStickyOrderedBroadcastAsUser(Intent, UserHandle, BroadcastReceiver, Handler, Result, String, Bundle)
Obsolete.

Version of #sendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, int, String, Bundle) that allows you to specify the user the broadcast will be sent to.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetTheme(Int32)

Set the base theme for this context.

SetWallpaper(Bitmap)
Obsolete.

This member is deprecated.

SetWallpaper(Stream)
Obsolete.

This member is deprecated.

StartActivities(Intent[], Bundle)

Launch multiple new activities.

StartActivities(Intent[])

Same as #startActivities(Intent[], Bundle) with no options specified.

StartActivity(Intent, Bundle)

Launch a new activity.

StartActivity(Intent)

Same as #startActivity(Intent, Bundle) with no options specified.

StartActivity(Type)
StartForegroundService(Intent)

Similar to #startService(Intent), but with an implicit promise that the Service will call android.app.Service#startForeground(int, android.app.Notification) startForeground(int, android.app.Notification) once it begins running.

StartInstrumentation(ComponentName, String, Bundle)

Start executing an android.app.Instrumentation class.

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

Like #startActivity(Intent, Bundle), but taking a IntentSender to start.

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

Same as #startIntentSender(IntentSender, Intent, int, int, int, Bundle) with no options specified.

StartService(Intent)

Request that a given application service be started.

StopService(Intent)

Request that a given application service be stopped.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnbindService(IServiceConnection)

Disconnect from an application service.

UnregisterComponentCallbacks(IComponentCallbacks)

Remove a ComponentCallbacks object that was previously registered with #registerComponentCallbacks(ComponentCallbacks).

UnregisterDeviceIdChangeListener(IIntConsumer)

Removes a device ID changed listener from the Context.

UnregisterFromRuntime() (Inherited from Object)
UnregisterReceiver(BroadcastReceiver)

Unregister a previously registered BroadcastReceiver.

UpdateServiceGroup(IServiceConnection, Int32, Int32)

For a service previously bound with #bindService or a related method, change how the system manages that service's process in relation to other processes.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to