0 votes
by (210 points)
recategorized by

求解答

1 Answer

0 votes
by (55.5k points)

可以试下这个方法

   startVRShell(1, arrayOf("com.pvr.filemanager"))

    fun startVRShell(way: Int, args: Array<String?>?) {
            val vrsIntent = Intent("pvr.intent.action.VRSHELL")
            vrsIntent.putExtra("way", way)
            vrsIntent.putExtra("args", args)
            vrsIntent.flags = (Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED)
            startActivity(vrsIntent)
    }
asked Aug 16, 2021 by (210 points)
recategorized Aug 17, 2021 by
java中也是一样的action吗
by (210 points)

java中不一样吧

by (210 points)
String[] args = {"com.pvr.filemanager"};
            intent.setAction("pvr.intent.action.CHELL");
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
            intent.putExtra("way", 1);
            intent.putExtra("args", args);
            startActivity(intent);

是这样吗

by (55.5k points)
Intent vrsIntent = new Intent("pvr.intent.action.VRSHELL");
vrsIntent.putExtra("way", 1);
vrsIntent.putExtra("args", new String[]{"com.pvr.filemanager"});
vrsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
        | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
startActivity(vrsIntent);
...