2

i want to call a non-static void method of java from Unity.

I read the answer at ( Unity3d integration with android).

In this What is "currentActivity" ? am getting an error "no static field with name='currentActivity' ...." etc

code :

AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); 
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");

Is UnityPlayer is a class in Java ? What is "currentActivity" ?

Community
  • 1
  • 1

1 Answers1

1

"CurrentActivity" might be the public static class name where your java function is declared.

Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98