예제 #1
0
        public static void OpenOtherAppOnDevice(string package, Action onAppNotInstalled = null)
        {
            if (AGUtils.IsNotAndroid())
            {
                return;
            }

            try
            {
                var launchIntent = AGUtils.GetLaunchIntent(package);
                launchIntent.CallAJO("addCategory", AndroidIntent.CATEGORY_LAUNCHER);
                AGUtils.StartActivity(launchIntent);
            }
            catch (Exception ex)
            {
                if (Debug.isDebugBuild)
                {
                    Debug.Log("Could not find launch intent for package:" + package + ", Error: " + ex.StackTrace);
                }

                if (onAppNotInstalled != null)
                {
                    onAppNotInstalled();
                }
            }
        }