Android Guides | Samples

Android.Content.ContextWrapper Class

Proxying implementation of Context that simply delegates all of its calls to another Context.

See Also: ContextWrapper

Syntax

[Android.Runtime.Register("android/content/ContextWrapper", DoNotGenerateAcw=true)]
public class ContextWrapper : Context

Remarks

Proxying implementation of Context that simply delegates all of its calls to another Context. Can be subclassed to modify behavior without changing the original Context.

[Android Documentation]

Requirements

Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

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

See Also: Context

Public Constructors

Protected Constructors

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

Public Properties

[read-only]
override
ApplicationContextContext. Return the context of the single, global Application object of the current process.
[read-only]
override
ApplicationInfoApplicationInfo. Return the full application info for this context's package.
[read-only]
override
AssetsAssetManager. Return an AssetManager instance for your application's package.
[read-only]
BaseContextContext.
[read-only]
override
CacheDirFile. Returns the absolute path to the application specific cache directory on the filesystem.
[read-only]
override
ClassLoaderClassLoader. Return a class loader you can use to retrieve classes in this package.
[read-only]
override
CodeCacheDirFile. Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code.
[read-only]
override
ContentResolverContentResolver. Return a ContentResolver instance for your application's package.
[read-only]
override
ExternalCacheDirFile. Returns the absolute path to the directory on the primary external filesystem (that is somewhere on Environment.ExternalStorageDirectory where the application can place cache files it owns.
[read-only]
override
FilesDirFile. Returns the absolute path to the directory on the filesystem where files created with Context.OpenFileOutput(String,FileCreationMode) are stored.
[read-only]
override
MainLooperLooper. Return the Looper for the main thread of the current process.
[read-only]
override
NoBackupFilesDirFile. Returns the absolute path to the directory on the filesystem similar to Context.FilesDir.
[read-only]
override
ObbDirFile. Return the primary external storage directory where this application's OBB files (if there are any) can be found.
[read-only]
override
PackageCodePathString. Return the full path to this context's primary Android package.
[read-only]
override
PackageManagerPackageManager. Return PackageManager instance to find global package information.
[read-only]
override
PackageNameString. Return the name of this application's package.
[read-only]
override
PackageResourcePathString. Return the full path to this context's primary Android package.
[read-only]
override
ResourcesResources. Return a Resources instance for your application's package.
[read-only]
override
ThemeResources+Theme. Return the Theme object associated with this Context.
[read-only]
override
WallpaperDrawable.
[read-only]
override
WallpaperDesiredMinimumHeightInt32.
[read-only]
override
WallpaperDesiredMinimumWidthInt32.

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

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

Protected Methods

AttachBaseContext(Context)
Set the base context for this ContextWrapper.