0 votes
by (1.5k points)
edited by

Please, provide an intent on how to invoke Video Capture shortcut from Pico System Menu in Unity.

1 Answer

0 votes
by (30.5k points)
selected by
Best answer

AndroidJavaObject context = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");

AndroidJavaObject intent = new AndroidJavaObject("android.content.Intent");

intent.Call<AndroidJavaObject>("setAction", "pvr.intent.action.RECORD");

intent.Call<AndroidJavaObject>("setPackage", "com.pvr.shortcut");

intent.Call<AndroidJavaObject>("putExtra", "action_type", 0);

//0: prepares to record screen; 1: starts to record screen; 2: immediate call

context.Call<AndroidJavaObject>("startService", intent);

Please remeber to add <AndroidJavaObject>