Android的意图打开"海量存储活性QUOT; [英] Android Intent to open "Mass Storage Activity"
本文介绍了Android的意图打开"海量存储活性QUOT;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从我的应用程序中打开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();
}
这篇关于Android的意图打开"海量存储活性QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文