因此,我一直坚持这个问题的字面天。我已经将Eclipse与IDE集成在一起,我可以完美地构建和部署项目。但是,即时通讯尝试在java端启动一个基本的Intent,并在Unity/C#端触发它。在C#/ Unity中启动外部Android应用程序
这里是我的Java端代码:
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.unity3d.player.UnityPlayerNativeActivity;
public class AppLauncher extends UnityPlayerNativeActivity
{
public Intent myIntent;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//Assuming that we want to launch the browser to browse a website
Uri uri = Uri.parse("http://www.google.com");
myIntent= new Intent(Intent.ACTION_VIEW, uri);
}
public void Trigger()
{
startActivity(myIntent);
}
}
这里的错误IM通过logcat中得到抛出时,C#触发被击中:
这是我的了,如果它的C#端代码:
if(s[0].Equals("Spr"))
{
print("Launched");
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
jo.Call("Trigger");
}
这里的错误IM通过logcat中得到抛出时,C#触发被击中:
AndroidJavaException: java.lang.NoSuchMethodError: no method with name='Trigger' signature='()V' in class Lcom/unity3d/player/UnityPlayerNativeActivity;
我已经尝试了通过passong自定义签名以及在C#脚本中的触发器方法名称,我尝试过扩展标准的UnityPlayerActivity,等等......我已经尝试了几个小时的东西,我似乎无法解决这个问题。
任何帮助被大大接受!
有人吗?真的需要帮助! – Jack 2014-10-19 04:19:05