Table of Contents

Class XuiApplication

Namespace
Xui.Runtime.Android.Actual
Assembly
Xui.Runtime.Android.dll
public class XuiApplication : Application, IComponentCallbacks2, IComponentCallbacks, IJavaObject, IJavaPeerable, IDisposable, IRunLoop
Inheritance
XuiApplication
Implements
Inherited Members

Constructors

XuiApplication(nint, JniHandleOwnership)

public XuiApplication(nint handle, JniHandleOwnership ownership)

Parameters

handle nint
ownership JniHandleOwnership

Properties

Abstract

public Application? Abstract { get; }

Property Value

Application

Instance

public static XuiApplication? Instance { get; }

Property Value

XuiApplication

Methods

OnCreate()

Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created.

public override void OnCreate()

Remarks

Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created.

Implementations should be as quick as possible (for example using lazy initialization of state) since the time spent in this function directly impacts the performance of starting the first activity, service, or receiver in a process.

If you override this method, be sure to call super.onCreate().

Be aware that direct boot may also affect callback order on Android android.os.Build.VERSION_CODES#N and later devices. Until the user unlocks the device, only direct boot aware components are allowed to run. You should consider that all direct boot unaware components, including such android.content.ContentProvider, are disabled until user unlock happens, especially when component callback order matters.

Java documentation for

android.app.Application.onCreate()
.

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.

OnLowMemory()

This is called when the overall system is running low on memory, and actively running processes should trim their memory usage.

public override void OnLowMemory()

Remarks

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.

OnTerminate()

This method is for use in emulated process environments.

public override void OnTerminate()

Remarks

This method is for use in emulated process environments. It will never be called on a production Android device, where processes are removed by simply killing them; no user code (including this callback) is executed when doing so.

Java documentation for

android.app.Application.onTerminate()
.

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.

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.

public override void OnTrimMemory(TrimMemory level)

Parameters

level TrimMemory

The context of the trim, giving a hint of the amount of trimming the application may like to perform. May be TrimMemoryComplete, TrimMemoryModerate, TrimMemoryBackground, TrimMemoryUiHidden, TrimMemoryRunningCritical, TrimMemoryRunningLow, or TrimMemoryRunningModerate.

Remarks

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.

Quit()

Requests that the run loop exit gracefully. On platforms with a definite exit (Win32, macOS) this posts a quit message to the main thread. On platforms without a run loop (iOS, Browser) this is a no-op.

public void Quit()

Run()

Starts the main run loop for the application. This method may block until the application terminates or exits naturally. On platforms with built-in UI event loops (e.g., iOS, Android), this method may return immediately after bootstrapping the application delegate.

public int Run()

Returns

int

The application’s exit code.