cancel
Showing results for 
Search instead for 
Did you mean: 

Crash using System Deep Link in Unity

Tolera989
Honored Guest

Hi I'm trying to use the ADB command or Android Intent code as seen here to open the native Quest 3 file browser app

adb shell am start -a android.intent.action.VIEW -n com.oculus.vrshell/.MainActivity -d "systemux://file-manager" -e "uri" "/media/"
public static void LaunchGalleryApp()
        {
            if (Application.platform != RuntimePlatform.Android)
            {
                return;
            }

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

            AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
            AndroidJavaObject uriData = uriClass.CallStatic<AndroidJavaObject>("parse", "systemux://file-manager");
            AndroidJavaObject intent = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage", "com.oculus.vrshell");
            intent.Call<AndroidJavaObject>("setData", uriData);
            currentActivity.Call("startActivity", intent);
        }


however when I use either of these methods on a Quest 3 build in a blank Unity 2022.3.15f1 scene it causes the headset to slow down after every use and eventually crashes it.
Any ideas or build settings tweaks on how to fix this would be appreciated, thanks!

0 REPLIES 0