public static void StartActivity(AndroidJavaObject intent) { try { Activity.Call("startActivity", intent); } catch (AndroidJavaException exception) { Debug.LogError("Could not start the activity with " + intent.JavaToString() + ": " + exception.Message); } }
public static void StartActivityWithChooser(AndroidJavaObject intent, string chooserTitle) { try { AndroidJavaObject jChooser = intent.CallStatic <AndroidJavaObject>("createChooser", intent, chooserTitle); Activity.Call("startActivity", jChooser); } catch (AndroidJavaException exception) { Debug.LogError("Could not start the activity with " + intent.JavaToString() + ": " + exception.Message); } }
public static void StartActivityWithChooser(AndroidJavaObject intent, string chooserTitle) { try { var jChooser = intent.CallStaticAJO("createChooser", intent, chooserTitle); Activity.Call("startActivity", jChooser); } catch (AndroidJavaException exception) { Debug.LogWarning("Could not start the activity with " + intent.JavaToString() + ": " + exception.Message); } finally { intent.Dispose(); } }
public static void StartActivity(AndroidJavaObject intent, Action fallback = null) { try { Activity.Call("startActivity", intent); } catch (AndroidJavaException exception) { if (Debug.isDebugBuild) { Debug.LogWarning("Could not start the activity with " + intent.JavaToString() + ": " + exception.Message); } if (fallback != null) { fallback(); } } finally { intent.Dispose(); } }
void onFailure(AndroidJavaObject exception) { AwarenessSceneHelper.Queue(() => _failure(exception.JavaToString())); }