Search code examples
c#androidandroid-activityunity-game-engineflurry

Does Unity currentActivity changes during scene changes?


I am currently implementing Flurry Analytics for my Unity Android Project. I have a question in mind when I came across the implementation guide provided by Flurry. In order to send data to the Flurry servers, the start and end function for flurry have to pass in the same Activity parameter.

I am currently using AndroidJavaClass to call upon the functions in the jar file passing in Unity's currentActivity.

Here comes my question, Does Unity's currentActivity changes when the scene changes? Or does it change at any point of time? This is important as the activity is used as a parameter to start/stop the flurry session.


Solution

    1. Unity uses single activity throughout. So Unity doesn't changes its current activity which is com.unity3d.player.UnityPlayerActivity if you check it in AndroidManifest.xml file.

    2. Unity Only changes activity whenever you launche anything native thing or video to com.unity3d.player.UnityPlayerNativeActivity or com.unity3d.player.VideoPlayer. These are just examples.