Hi guys!
I have a problem sending a variable of type Activity from C# to Java.
The following source code is what I did in C#:
public static string TestJava()
{
string somestring = "";
activity = playerClass.GetStatic<AndroidJavaObject>("currentActivity");
pluginClass =
new AndroidJavaClass("com.Vector3GameStudio.GoogleMobileAds.GoogleMobileAdsActivity");
try
{
}
catch (Exception e)
{
somestring += "ERROR invoking Test" + e.Message;
}
return somestring;
}
And the following source code is the Java method who it will recieve the Activity.
public static void Test(Activity currentActivity)
{
// Doesn't get here at all
}
If I change the parameter Activity in the Java method by String, int and so on, the code works well but if I change it by an Activity, the java invocation doesn't work. To check what is wrong in my code I print the exception message, obtaining the following message:
Tetsjava.lang.NSuchMethodError: no static method match with name='Test' signature='(Loomunity3d.player.UnityPlayerActivity;)V' in class
Could someone help me with that?
Thank you in advance!