Function makepad_android_state::get_activity

source ·
pub fn get_activity() -> jobject
Expand description

Returns a raw pointer to the main Makepad Activity instance.

Note that the caller should not cache or re-use the returned activity pointer, but should instead re-call this function whenever the activity instance is needed. This is because the activity instance may be destroyed and recreated behind the scenes upon certain system actions, e.g., when the device is rotated, the app is put into split screen, resized/moved, etc.

If the Activity instance has not been initialized, this returns a null pointer.