Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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
UnityPlayerActivity
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
UnityPlayerActivity
.
Notes:
  • If you're creating a custom activity with GameActivity application entry point, you need to extend the
    UnityPlayerGameActivity
    class.
  • UnityPlayerActivity
    and
    UnityPlayerGameActivity
    use the
    UnityPlayerForActivityOrService
    and
    UnityPlayerForGameActivity
    bridge classes respectively. Unity splits these bridge classes from the
    UnityPlayer
    Java class. To create a custom activity, extend
    UnityPlayerActivity
    or
    UnityPlayerGameActivity
    and not the bridge classes. If your activity code references the
    UnityPlayer
    class directly, rename it to the relevant bridge class to avoid compile errors.

Topic

Description

Create a custom activityExtend the default Unity activity to control interactions between Unity and Android.
Specify Android Player command-line argumentsSpecify startup command-line arguments to pass to Unity.

Additional resources