Android Guides | Samples

Android.App.Application Class

Base class for those who need to maintain global application state.

See Also: Application Members

Syntax

[Android.Runtime.Register("android/app/Application", DoNotGenerateAcw=true)]
public class Application : ContextWrapper, IComponentCallbacks2, IDisposable

Remarks

Base class for those who need to maintain global application state. You can provide your own implementation by specifying its name in your AndroidManifest.xml's <application> tag, which will cause that class to be instantiated for you when the process for your application/package is created.

There is normally no need to subclass Application. In most situation, static singletons can provide the same functionality in a more modular way. If your singleton needs a global context (for example to register broadcast receivers), the function to retrieve it can be given a Context which internally uses Context.ApplicationContext when first constructing the singleton.

[Android Documentation]

Requirements

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

The members of Android.App.Application are listed below.

See Also: Inherited members from Android.Content.ContextWrapper

Public Constructors

Protected Constructors

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

Public Properties

[read-only]
static
ContextContext.
[read-only]
static
SynchronizationContextSynchronizationContext.

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

OnConfigurationChanged(Configuration)
Called by the system when the device configuration changes while your component is running.
OnCreate()
Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created.
OnLowMemory()
This is called when the overall system is running low on memory, and actively running processes should trim their memory usage.
OnTerminate()
This method is for use in emulated process environments.
OnTrimMemory(TrimMemory)
Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process.
RegisterActivityLifecycleCallbacks(IActivityLifecycleCallbacks)
RegisterOnProvideAssistDataListener(IOnProvideAssistDataListener)
UnregisterActivityLifecycleCallbacks(IActivityLifecycleCallbacks)
UnregisterOnProvideAssistDataListener(IOnProvideAssistDataListener)