我需要从我的应用程序打开USB大容量存储活动。
有没有Intent可以做到这一点?
就像这样
startActivity(new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS))
发布于 2013-08-23 19:33:52
您可以尝试使用以下命令:
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();
}https://stackoverflow.com/questions/8652917
复制相似问题