Extend the default Unity activity
Override basic interactions between the Android operating system and the Unity Android application.
Read time 1 minuteLast updated 12 days ago
The of a Unity Android application is responsible for basic interactions between the Android operating system and the application. You can use plug-ins to create your own Activity that extends and overrides Unity's default .
UnityPlayerActivityUnityPlayerActivityNotes:
- If you're creating a custom activity with GameActivity application entry point, you need to extend the class.
UnityPlayerGameActivity - and
UnityPlayerActivityuse theUnityPlayerGameActivityandUnityPlayerForActivityOrServicebridge classes respectively. Unity splits these bridge classes from theUnityPlayerForGameActivityJava class. To create a custom activity, extendUnityPlayerorUnityPlayerActivityand not the bridge classes. If your activity code references theUnityPlayerGameActivityclass directly, rename it to the relevant bridge class to avoid compile errors.UnityPlayer
Topic | Description |
|---|---|
| Create a custom activity | Extend the default Unity activity to control interactions between Unity and Android. |
| Specify Android Player command-line arguments | Specify startup command-line arguments to pass to Unity. |