我需要从我的应用程序中打开USB大容量存储设备的活动。
I need to open USB Mass Storage Activity from my application.
是否有任何意图
来做到这一点?
Is there any Intent
to do this?
像
startActivity(新意图(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS))
您可以尝试使用以下内容:
You can try to use following:
苏-c setprop sys.usb.config<指挥GT;
完全可以通过这一个命令来找到列表:结果猫init.usb.rc
Full list of can be found by this one command:
cat init.usb.rc
功能才能够从应用程序运行命令:
Function to be able to run command from app:
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();
}