Hi there.
I am trying to call some Java code to open a browser window on Oculus Quest.
Here is my script…
var intent = new AndroidJavaObject("android.content.Intent", "com.oculus.vrshell.intent.action.LAUNCH");
intent.Call("setPackage", "com.oculus.vrshell");
intent.Call("putExtra", "uri", "ovrweb://webtask?uri=" + url);
intent.Call("putExtra", "intent_data", new AndroidJavaClass("android.net.Uri").CallStatic<AndroidJavaObject>("parse", "systemux://browser"));
new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity").Call("sendBroadcast", intent);
Unfortunately, when I build and execute I get the following error…
02-19 08:47:51.388: E/Unity(8979): AndroidJavaException: java.lang.NoSuchMethodError: no non-static method with name=‘setPackage’ signature=‘(Ljava/lang/String;)V’ in class Landroid.content.Intent;
02-19 08:47:51.388: E/Unity(8979): (Filename: currently not available on il2cpp Line: -1)
Any idea what I am doing wrong?
Thanks in advance!
Dan