Android.Content.Context Members

The members of Android.Content.Context are listed below.

See Also: Inherited members from Java.Lang.Object

Public Constructors

Protected Constructors

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

Public Fields

const
AccessibilityServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Views.Accessibility.AccessibilityManager for giving the user feedback for UI events through the registered event listeners.
const
AccountServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Accounts.AccountManager for receiving intents at a time of your choosing.
const
ActivityServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.ActivityManager for interacting with the global system state.
const
AlarmServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.AlarmManager for receiving intents at a time of your choosing.
const
AppOpsServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.AppOpsManager for tracking application operations on the device.
const
AppwidgetServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Appwidget.AppWidgetManager for accessing AppWidgets.
const
AudioServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Media.AudioManager for handling management of volume, ringer modes and audio routing.
const
BatteryServicestring. Use with Context.GetSystemService(string) to retrieve a Android.OS.BatteryManager for managing battery state.
const
BluetoothServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Bluetooth.BluetoothAdapter for using Bluetooth.
const
CameraServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Hardware.Camera2.CameraManager for interacting with camera devices.
const
CaptioningServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Views.Accessibility.CaptioningManager for obtaining captioning properties and listening for changes in captioning preferences.
const
ClipboardServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Text.ClipboardManager for accessing and modifying the contents of the global clipboard.
const
ConnectivityServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Net.ConnectivityManager for handling management of network connections.
const
ConsumerIrServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Hardware.ConsumerIrManager for transmitting infrared signals from the device.
const
DevicePolicyServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.Admin.DevicePolicyManager for working with global device policy management.
const
DisplayServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Hardware.Display.DisplayManager for interacting with display devices.
const
DownloadServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.DownloadManager for requesting HTTP downloads.
const
DropboxServicestring. Use with Context.GetSystemService(string) to retrieve a Android.OS.DropBoxManager instance for recording diagnostic logs.
const
InputMethodServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Views.InputMethods.InputMethodManager for accessing input methods.
const
InputServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Hardware.Input.InputManager for interacting with input devices.
const
JobSchedulerServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.Job.JobScheduler instance for managing occasional background tasks.
const
KeyguardServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.NotificationManager for controlling keyguard.
const
LauncherAppsServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Content.PM.LauncherApps for querying and monitoring launchable apps across profiles of a user.
const
LayoutInflaterServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Views.LayoutInflater for inflating layout resources in this context.
const
LocationServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Locations.LocationManager for controlling location updates.
const
MediaProjectionServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Media.Projection.MediaProjectionManager instance for managing media projection sessions.
const
MediaRouterServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Media.MediaRouter for controlling and managing routing of media.
const
MediaSessionServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Media.Session.MediaSessionManager for managing media Sessions.
const
NfcServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Nfc.NfcManager for using NFC.
const
NotificationServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.NotificationManager for informing the user of background events.
const
NsdServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Net.Nsd.NsdManager for handling management of network service discovery
const
PowerServicestring. Use with Context.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.
const
PrintServicestring. Android.Print.PrintManager for printing and managing printers and print tasks.
const
RestrictionsServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Content.RestrictionsManager for retrieving application restrictions and requesting permissions for restricted operations.
const
SearchServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.SearchManager for handling searches.
const
SensorServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Hardware.SensorManager for accessing sensors.
const
StorageServicestring. Use with Context.GetSystemService(string) to retrieve a Android.OS.Storage.StorageManager for accessing system storage functions.
const
TelecomServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Telecom.TelecomManager to manage telecom-related features of the device.
const
TelephonyServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Telephony.TelephonyManager for handling management the telephony features of the device.
const
TextServicesManagerServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Views.TextService.TextServicesManager for accessing text services.
const
TvInputServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Media.TV.TvInputManager for interacting with TV inputs on the device.
const
UiModeServicestring. Use with Context.GetSystemService(string) to retrieve a Android.App.UiModeManager for controlling UI modes.
const
UsbServicestring. Use with Context.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.
const
UserServicestring. Use with Context.GetSystemService(string) to retrieve a Android.OS.UserManager for managing users on devices that support multiple users.
const
VibratorServicestring. Use with Context.GetSystemService(string) to retrieve a Android.OS.Vibrator for interacting with the vibration hardware.
const
WallpaperServicestring. Use with Context.GetSystemService(string) to retrieve a com.android.server.
const
WifiP2pServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Net.Wifi.P2p.WifiP2pManager for handling management of Wi-Fi peer-to-peer connections.
const
WifiServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Net.Wifi.WifiManager for handling management of Wi-Fi access.
const
WindowServicestring. Use with Context.GetSystemService(string) to retrieve a Android.Views.IWindowManager for accessing the system's window manager.

Public Properties

[read-only]
abstract
ApplicationContextContext. Return the context of the single, global Application object of the current process.
[read-only]
abstract
ApplicationInfoAndroid.Content.PM.ApplicationInfo. Return the full application info for this context's package.
[read-only]
abstract
AssetsAndroid.Content.Res.AssetManager. Return an AssetManager instance for your application's package.
[read-only]
abstract
CacheDirJava.IO.File. Returns the absolute path to the application specific cache directory on the filesystem.
[read-only]
abstract
ClassLoaderJava.Lang.ClassLoader. Return a class loader you can use to retrieve classes in this package.
[read-only]
abstract
CodeCacheDirJava.IO.File. Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code.
[read-only]
abstract
ContentResolverContentResolver. Return a ContentResolver instance for your application's package.
[read-only]
abstract
ExternalCacheDirJava.IO.File. Returns the absolute path to the directory on the primary external filesystem (that is somewhere on Android.OS.Environment.ExternalStorageDirectory where the application can place cache files it owns.
[read-only]
abstract
FilesDirJava.IO.File. Returns the absolute path to the directory on the filesystem where files created with Context.OpenFileOutput(string, Android.Content.FileCreationMode) are stored.
[read-only]
IsRestrictedbool. Indicates whether this Context is restricted.
[read-only]
abstract
MainLooperAndroid.OS.Looper. Return the Looper for the main thread of the current process.
[read-only]
abstract
NoBackupFilesDirJava.IO.File. Returns the absolute path to the directory on the filesystem similar to Context.FilesDir.
[read-only]
abstract
ObbDirJava.IO.File. Return the primary external storage directory where this application's OBB files (if there are any) can be found.
[read-only]
abstract
PackageCodePathstring. Return the full path to this context's primary Android package.
[read-only]
abstract
PackageManagerAndroid.Content.PM.PackageManager. Return PackageManager instance to find global package information.
[read-only]
abstract
PackageNamestring. Return the name of this application's package.
[read-only]
abstract
PackageResourcePathstring. Return the full path to this context's primary Android package.
[read-only]
abstract
ResourcesAndroid.Content.Res.Resources. Return a Resources instance for your application's package.
[read-only]
abstract
ThemeAndroid.Content.Res.Resources.Theme. Return the Theme object associated with this Context.
[read-only]
abstract
WallpaperAndroid.Graphics.Drawables.Drawable.
[read-only]
abstract
WallpaperDesiredMinimumHeightint.
[read-only]
abstract
WallpaperDesiredMinimumWidthint.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

abstract
BindService(Intent, IServiceConnection, Bind) : bool
Connect to an application service, creating it if needed.
abstract
CheckCallingOrSelfPermission(string) : Android.Content.PM.Permission
Determine whether the calling process of an IPC or you have been granted a particular permission.
abstract
CheckCallingOrSelfUriPermission(Android.Net.Uri, ActivityFlags) : Android.Content.PM.Permission
Determine whether the calling process of an IPC or you has been granted permission to access a specific URI.
abstract
CheckCallingPermission(string) : Android.Content.PM.Permission
Determine whether the calling process of an IPC you are handling has been granted a particular permission.
abstract
CheckCallingUriPermission(Android.Net.Uri, ActivityFlags) : Android.Content.PM.Permission
Determine whether the calling process and user ID has been granted permission to access a specific URI.
abstract
CheckPermission(string, int, int) : Android.Content.PM.Permission
Determine whether the given permission is allowed for a particular process and user ID running in the system.
abstract
CheckUriPermission(Android.Net.Uri, int, int, ActivityFlags) : Android.Content.PM.Permission
Determine whether a particular process and user ID has been granted permission to access a specific URI.
abstract
CheckUriPermission(Android.Net.Uri, string, string, int, int, ActivityFlags) : Android.Content.PM.Permission
Check both a Uri and normal permission.
abstract
ClearWallpaper()
abstract
CreateConfigurationContext(Android.Content.Res.Configuration) : Context
Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration.
abstract
CreateDisplayContext(Android.Views.Display) : Context
Return a new Context object for the current Context but whose resources are adjusted to match the metrics of the given Display.
abstract
CreatePackageContext(string, PackageContextFlags) : Context
Return a new Context object for the given application name.
abstract
DatabaseList() : string[]
Returns an array of strings naming the private databases associated with this Context's application package.
abstract
DeleteDatabase(string) : bool
Delete an existing private SQLiteDatabase associated with this Context's application package.
abstract
DeleteFile(string) : bool
Delete the given private file associated with this Context's application package.
abstract
EnforceCallingOrSelfPermission(string, string)
If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a Java.Lang.SecurityException.
abstract
EnforceCallingOrSelfUriPermission(Android.Net.Uri, ActivityFlags, string)
If the calling process of an IPC or you has not been granted permission to access a specific URI, throw Java.Lang.SecurityException.
abstract
EnforceCallingPermission(string, string)
If the calling process of an IPC you are handling has not been granted a particular permission, throw a Java.Lang.SecurityException.
abstract
EnforceCallingUriPermission(Android.Net.Uri, ActivityFlags, string)
If the calling process and user ID has not been granted permission to access a specific URI, throw Java.Lang.SecurityException.
abstract
EnforcePermission(string, int, int, string)
If the given permission is not allowed for a particular process and user ID running in the system, throw a Java.Lang.SecurityException.
abstract
EnforceUriPermission(Android.Net.Uri, int, int, ActivityFlags, string)
If a particular process and user ID has not been granted permission to access a specific URI, throw Java.Lang.SecurityException.
abstract
EnforceUriPermission(Android.Net.Uri, string, string, int, int, ActivityFlags, string)
Enforce both a Uri and normal permission.
abstract
FileList() : string[]
Returns an array of strings naming the private files associated with this Context's application package.
abstract
GetDatabasePath(string) : Java.IO.File
Returns the absolute path on the filesystem where a database created with Context.OpenOrCreateDatabase(string, Android.Content.FileCreationMode, Android.Content.FileCreationMode) is stored.
abstract
GetDir(string, FileCreationMode) : Java.IO.File
Retrieve, creating if needed, a new directory in which the application can place its own custom data files.
GetDrawable(int) : Android.Graphics.Drawables.Drawable
Return a drawable object associated with a particular resource ID and styled for the current theme.
abstract
GetExternalCacheDirs() : Java.IO.File[]
Returns absolute paths to application-specific directories on all external storage devices where the application can place cache files it owns.
abstract
GetExternalFilesDir(string) : Java.IO.File
Returns the absolute path to the directory on the primary external filesystem (that is somewhere on Android.OS.Environment.ExternalStorageDirectory) where the application can place persistent files it owns.
abstract
GetExternalFilesDirs(string) : Java.IO.File[]
Returns absolute paths to application-specific directories on all external storage devices where the application can place persistent files it owns.
abstract
GetExternalMediaDirs() : Java.IO.File[]
Returns absolute paths to application-specific directories on all external storage devices where the application can place media files.
abstract
GetFileStreamPath(string) : Java.IO.File
Returns the absolute path on the filesystem where a file created with Context.OpenFileOutput(string, Android.Content.FileCreationMode) is stored.
abstract
GetObbDirs() : Java.IO.File[]
Returns absolute paths to application-specific directories on all external storage devices where the application's OBB files (if there are any) can be found.
abstract
GetSharedPreferences(string, FileCreationMode) : ISharedPreferences
Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values.
GetString(int) : string
Return a localized string from the application's package's default string table.
GetString(int, params Java.Lang.Object[]) : string
Documentation for this section has not yet been entered.
abstract
GetSystemService(string) : Java.Lang.Object
Return the handle to a system-level service by name.
GetText(int) : string
Documentation for this section has not yet been entered.
GetTextFormatted(int) : Java.Lang.ICharSequence
Return a localized, styled CharSequence from the application's package's default string table.
abstract
GrantUriPermission(string, Android.Net.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.
ObtainStyledAttributes(int[]) : Android.Content.Res.TypedArray
Retrieve styled attribute information in this Context's theme.
ObtainStyledAttributes(Android.Util.IAttributeSet, int[]) : Android.Content.Res.TypedArray
Retrieve styled attribute information in this Context's theme.
ObtainStyledAttributes(int, int[]) : Android.Content.Res.TypedArray
Retrieve styled attribute information in this Context's theme.
ObtainStyledAttributes(Android.Util.IAttributeSet, int[], int, int) : Android.Content.Res.TypedArray
Retrieve styled attribute information in this Context's theme.
abstract
OpenFileInput(string) : System.IO.Stream
Open a private file associated with this Context's application package for reading.
abstract
OpenFileOutput(string, FileCreationMode) : System.IO.Stream
Open a private file associated with this Context's application package for writing.
abstract
OpenOrCreateDatabase(string, FileCreationMode, Android.Database.Sqlite.SQLiteDatabase.ICursorFactory) : Android.Database.Sqlite.SQLiteDatabase
Open a new private SQLiteDatabase associated with this Context's application package.
abstract
OpenOrCreateDatabase(string, FileCreationMode, Android.Database.Sqlite.SQLiteDatabase.ICursorFactory, Android.Database.IDatabaseErrorHandler) : Android.Database.Sqlite.SQLiteDatabase
Open a new private SQLiteDatabase associated with this Context's application package.
abstract
PeekWallpaper() : Android.Graphics.Drawables.Drawable
RegisterComponentCallbacks(IComponentCallbacks)
Add a new Android.Content.IComponentCallbacks 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.
abstract
RegisterReceiver(BroadcastReceiver, IntentFilter) : Intent
Register a BroadcastReceiver to be run in the main activity thread.
abstract
RegisterReceiver(BroadcastReceiver, IntentFilter, string, Android.OS.Handler) : Intent
Register to receive intent broadcasts, to run in the context of scheduler.
abstract
RemoveStickyBroadcast(Intent)
abstract
RemoveStickyBroadcastAsUser(Intent, Android.OS.UserHandle)
abstract
RevokeUriPermission(Android.Net.Uri, ActivityFlags)
Remove all permissions to access a particular content provider Uri that were previously added with Context.GrantUriPermission(string, Android.Net.Uri, Android.Net.Uri).
abstract
SendBroadcast(Intent)
Broadcast the given intent to all interested BroadcastReceivers.
abstract
SendBroadcast(Intent, string)
Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced.
abstract
SendBroadcastAsUser(Intent, Android.OS.UserHandle)
Version of Context.SendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.
abstract
SendBroadcastAsUser(Intent, Android.OS.UserHandle, string)
Version of Context.SendBroadcast(Intent, System.String) that allows you to specify the user the broadcast will be sent to.
abstract
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.
abstract
SendOrderedBroadcast(Intent, string, BroadcastReceiver, Android.OS.Handler, Android.App.Result, string, Android.OS.Bundle)
Version of Context.SendBroadcast(Intent) that allows you to receive data back from the broadcast.
abstract
SendOrderedBroadcastAsUser(Intent, Android.OS.UserHandle, string, BroadcastReceiver, Android.OS.Handler, Android.App.Result, string, Android.OS.Bundle)
Version of Context.SendOrderedBroadcast(Intent, System.String, System.String, System.String, System.String, System.String, System.String) that allows you to specify the user the broadcast will be sent to.
abstract
SendStickyBroadcast(Intent)
abstract
SendStickyBroadcastAsUser(Intent, Android.OS.UserHandle)
abstract
SendStickyOrderedBroadcast(Intent, BroadcastReceiver, Android.OS.Handler, Android.App.Result, string, Android.OS.Bundle)
abstract
SendStickyOrderedBroadcastAsUser(Intent, Android.OS.UserHandle, BroadcastReceiver, Android.OS.Handler, Android.App.Result, string, Android.OS.Bundle)
abstract
SetTheme(int)
Set the base theme for this context.
abstract
SetWallpaper(Android.Graphics.Bitmap)
abstract
SetWallpaper(System.IO.Stream)
abstract
StartActivities(Intent[])
Same as Context.StartActivities(Intent[], Android.OS.Bundle) with no options specified.
abstract
StartActivities(Intent[], Android.OS.Bundle)
Launch multiple new activities.
abstract
StartActivity(Intent)
Same as Context.StartActivity(Intent, Android.OS.Bundle) with no options specified.
StartActivity(Type)
Documentation for this section has not yet been entered.
abstract
StartActivity(Intent, Android.OS.Bundle)
Launch a new activity.
abstract
StartInstrumentation(ComponentName, string, Android.OS.Bundle) : bool
Start executing an Android.App.Instrumentation class.
abstract
StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, int)
Same as Context.StartIntentSender(IntentSender, Android.Content.Intent, Android.Content.Intent, Android.Content.Intent, Android.Content.Intent, Android.Content.Intent) with no options specified.
abstract
StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, int, Android.OS.Bundle)
Like Context.StartActivity(Intent, Android.OS.Bundle), but taking a IntentSender to start.
abstract
StartService(Intent) : ComponentName
Request that a given application service be started.
abstract
StopService(Intent) : bool
Request that a given application service be stopped.
abstract
UnbindService(IServiceConnection)
Disconnect from an application service.
UnregisterComponentCallbacks(IComponentCallbacks)
Remove a Android.Content.IComponentCallbacks object that was previously registered with Context.RegisterComponentCallbacks(IComponentCallbacks).
abstract
UnregisterReceiver(BroadcastReceiver)
Unregister a previously registered BroadcastReceiver.