【问题标题】:Android Intent to open "Mass Storage Activity"Android Intent 打开“大容量存储活动”
【发布时间】:2011-12-28 07:05:28
【问题描述】:

我需要从我的应用程序中打开 USB 大容量存储活动。

有没有Intent可以做这个?

类似

startActivity(new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS))

【问题讨论】:

  • “海量存储活动”是什么意思?您是指 USB 计算机连接子设置页面,可让您在 ICS+ 设备上的 MTP 和 PTP 之间进行选择?

标签: android android-intent usb-mass-storage


【解决方案1】:

您可以尝试使用以下方法:

su -c setprop sys.usb.config <command>

可以通过这个命令找到完整列表:
cat init.usb.rc

能够从应用程序运行命令的功能:

   public void RunAsRoot(String[] cmds){
            Process p = Runtime.getRuntime().exec("su");
            DataOutputStream os = new DataOutputStream(p.getOutputStream());            
            for (String tmpCmd : cmds) {
                    os.writeBytes(tmpCmd+"\n");
            }           
            os.writeBytes("exit\n");  
            os.flush();
}

【讨论】:

    猜你喜欢
    • 2017-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多