Android Guides | Samples

Android.Content.Context: Method Members

The methods of Android.Content.Context are listed below. For a list of all members, see the Context list.

See Also: Object

Public Methods

abstract
BindService(Intent, IServiceConnection, Bind) : Boolean
Connect to an application service, creating it if needed.
abstract
CheckCallingOrSelfPermission(String) : Permission
Determine whether the calling process of an IPC or you have been granted a particular permission.
abstract
CheckCallingOrSelfUriPermission(Uri, ActivityFlags) : Permission
Determine whether the calling process of an IPC or you has been granted permission to access a specific URI.
abstract
CheckCallingPermission(String) : Permission
Determine whether the calling process of an IPC you are handling has been granted a particular permission.
abstract
CheckCallingUriPermission(Uri, ActivityFlags) : Permission
Determine whether the calling process and user ID has been granted permission to access a specific URI.
abstract
CheckPermission(String, Int32, Int32) : Permission
Determine whether the given permission is allowed for a particular process and user ID running in the system.
abstract
CheckUriPermission(Uri, Int32, Int32, ActivityFlags) : Permission
Determine whether a particular process and user ID has been granted permission to access a specific URI.
abstract
CheckUriPermission(Uri, String, String, Int32, Int32, ActivityFlags) : Permission
Check both a Uri and normal permission.
abstract
ClearWallpaper()
abstract
CreateConfigurationContext(Configuration) : Context
Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration.
abstract
CreateDisplayContext(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) : Boolean
Delete an existing private SQLiteDatabase associated with this Context's application package.
abstract
DeleteFile(String) : Boolean
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 SecurityException.
abstract
EnforceCallingOrSelfUriPermission(Uri, ActivityFlags, String)
If the calling process of an IPC or you has not been granted permission to access a specific URI, throw SecurityException.
abstract
EnforceCallingPermission(String, String)
If the calling process of an IPC you are handling has not been granted a particular permission, throw a SecurityException.
abstract
EnforceCallingUriPermission(Uri, ActivityFlags, String)
If the calling process and user ID has not been granted permission to access a specific URI, throw SecurityException.
abstract
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.
abstract
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.
abstract
EnforceUriPermission(Uri, String, String, Int32, Int32, 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) : File
Returns the absolute path on the filesystem where a database created with Context.OpenOrCreateDatabase(String,FileCreationMode,FileCreationMode) is stored.
abstract
GetDir(String, FileCreationMode) : File
Retrieve, creating if needed, a new directory in which the application can place its own custom data files.
GetDrawable(Int32) : Drawable
Returns a drawable object associated with a particular resource ID and styled for the current theme.
abstract
GetExternalCacheDirs() : 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) : File
Returns the absolute path to the directory on the primary external filesystem (that is somewhere on Environment.ExternalStorageDirectory) where the application can place persistent files it owns.
abstract
GetExternalFilesDirs(String) : File[]
Returns absolute paths to application-specific directories on all external storage devices where the application can place persistent files it owns.
abstract
GetExternalMediaDirs() : File[]
Returns absolute paths to application-specific directories on all external storage devices where the application can place media files.
abstract
GetFileStreamPath(String) : File
Returns the absolute path on the filesystem where a file created with Context.OpenFileOutput(String,FileCreationMode) is stored.
abstract
GetObbDirs() : 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(Int32) : String
Returns a localized string from the application's package's default string table.
GetString(Int32, params Object[]) : String
abstract
GetSystemService(String) : Object
Return the handle to a system-level service by name.
GetText(Int32) : String
GetTextFormatted(Int32) : ICharSequence
Return a localized, styled CharSequence from the application's package's default string table.
abstract
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.
ObtainStyledAttributes(Int32[]) : TypedArray
Retrieve styled attribute information in this Context's theme.
ObtainStyledAttributes(IAttributeSet, Int32[]) : TypedArray
Retrieve styled attribute information in this Context's theme.
ObtainStyledAttributes(Int32, Int32[]) : TypedArray
Retrieve styled attribute information in this Context's theme.
ObtainStyledAttributes(IAttributeSet, Int32[], Int32, Int32) : TypedArray
Retrieve styled attribute information in this Context's theme.
abstract
OpenFileInput(String) : Stream
Open a private file associated with this Context's application package for reading.
abstract
OpenFileOutput(String, FileCreationMode) : Stream
Open a private file associated with this Context's application package for writing.
abstract
OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory) : SQLiteDatabase
Open a new private SQLiteDatabase associated with this Context's application package.
abstract
OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory, IDatabaseErrorHandler) : SQLiteDatabase
Open a new private SQLiteDatabase associated with this Context's application package.
abstract
PeekWallpaper() : Drawable
RegisterComponentCallbacks(IComponentCallbacks)
Add a new 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, Handler) : Intent
Register to receive intent broadcasts, to run in the context of scheduler.
abstract
RemoveStickyBroadcast(Intent)
abstract
RemoveStickyBroadcastAsUser(Intent, UserHandle)
abstract
RevokeUriPermission(Uri, ActivityFlags)
Remove all permissions to access a particular content provider Uri that were previously added with Context.GrantUriPermission(String,Uri,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, UserHandle)
Version of Context.SendBroadcast(Intent) that allows you to specify the user the broadcast will be sent to.
abstract
SendBroadcastAsUser(Intent, UserHandle, String)
Version of Context.SendBroadcast(Intent,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, Handler, Result, String, Bundle)
Version of Context.SendBroadcast(Intent) that allows you to receive data back from the broadcast.
abstract
SendOrderedBroadcastAsUser(Intent, UserHandle, String, BroadcastReceiver, Handler, Result, String, Bundle)
Version of Context.SendOrderedBroadcast(Intent,String,String,String,String,String,String) that allows you to specify the user the broadcast will be sent to.
abstract
SendStickyBroadcast(Intent)
abstract
SendStickyBroadcastAsUser(Intent, UserHandle)
abstract
SendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, Result, String, Bundle)
abstract
SendStickyOrderedBroadcastAsUser(Intent, UserHandle, BroadcastReceiver, Handler, Result, String, Bundle)
abstract
SetTheme(Int32)
Set the base theme for this context.
abstract
SetWallpaper(Bitmap)
abstract
SetWallpaper(Stream)
abstract
StartActivities(Intent[])
Same as Context.StartActivities(Intent[],Bundle) with no options specified.
abstract
StartActivities(Intent[], Bundle)
Launch multiple new activities.
abstract
StartActivity(Intent)
Same as Context.StartActivity(Intent,Bundle) with no options specified.
StartActivity(Type)
abstract
StartActivity(Intent, Bundle)
Launch a new activity.
abstract
StartInstrumentation(ComponentName, String, Bundle) : Boolean
Start executing an Instrumentation class.
abstract
StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32)
Same as Context.StartIntentSender(IntentSender,Intent,Intent,Intent,Intent,Intent) with no options specified.
abstract
StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32, Bundle)
Like Context.StartActivity(Intent,Bundle), but taking a IntentSender to start.
abstract
StartService(Intent) : ComponentName
Request that a given application service be started.
abstract
StopService(Intent) : Boolean
Request that a given application service be stopped.
abstract
UnbindService(IServiceConnection)
Disconnect from an application service.
UnregisterComponentCallbacks(IComponentCallbacks)
Remove a IComponentCallbacks object that was previously registered with Context.RegisterComponentCallbacks(IComponentCallbacks).
abstract
UnregisterReceiver(BroadcastReceiver)
Unregister a previously registered BroadcastReceiver.