Last active
December 14, 2018 06:04
-
-
Save niusounds/aa82be8d3b0bd56b5a8957a41ef5cf77 to your computer and use it in GitHub Desktop.
Get Android Activity (Context) reference from Unity C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
var activity = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment