Indicates the Java instance of the current activity.
Notes:
Additional resources: AndroidApplication.currentContext.
using UnityEngine; using UnityEngine.Android;
public class Controller : MonoBehaviour { void Start() { var isRunningGameActivity = AndroidApplication.currentActivity.Call<string>("getLocalClassName").Equals("com.unity3d.player.UnityPlayerGameActivity"); var isRunningActivity = AndroidApplication.currentActivity.Call<string>("getLocalClassName").Equals("com.unity3d.player.UnityPlayerActivity"); Debug.Log($"GameActivity {isRunningGameActivity}"); Debug.Log($"Activity {isRunningActivity}"); } }