Vamshi Krishna Peddi
Vamshi Krishna Peddi

Reputation: 21

How to Call a non-static void method of java in Unity3d?

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" ?

Upvotes: 2

Views: 1626

Answers (1)

Reaz Murshed
Reaz Murshed

Reputation: 24231

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

Upvotes: 1

Related Questions