6

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

有什么Intent可以做的吗?

就像是

startActivity(new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS))

4

1 回答 1

0

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

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();
}
于 2013-08-23T11:33:51.807 回答