android_platform
only.Expand description
Re-export of the android_activity
API
Winit re-exports the android_activity
API for convenience so that most
applications can rely on the Winit crate to resolve the required version of
android_activity
and avoid any chance of a conflict between Winit and the
application crate.
Unlike most libraries there can only be a single implementation
of the android_activity
glue crate linked with an application because
it is responsible for the application’s android_main()
entry point.
Since Winit depends on a specific version of android_activity
the simplest
way to avoid creating a conflict is for applications to avoid explicitly
depending on the android_activity
crate, and instead consume the API that
is re-exported by Winit.
For compatibility applications should then import the [AndroidApp
] type for
their android_main(app: AndroidApp)
function like:
#[cfg(target_os = "android")]
use winit::platform::android::activity::AndroidApp;