Forum Discussion
Tolera989
1 year agoHonored Guest
Crash using System Deep Link in Unity
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!
No RepliesBe the first to reply
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 months ago
- 2 years ago