我想做什么:
我想把路径作为文件的字符串,我通过Android文件管理器选择.
是)我有的:
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
startActivityForResult(Intent.createChooser(intent, "Open with ..."), FILE_SELECT_CODE);
Run Code Online (Sandbox Code Playgroud)
这段代码对我来说效果不错,但有一个问题.我只能使用以下应用选择我的文件:
我的问题:
有没有人有通过Android文件管理器选择任何文件的工作代码?
我想把我看到的所有logcat Android Studio(比如这里http://i.imgur.com/IJkGcL4.png)都txt file直接保存在我的设备上.
到目前为止我尝试过的是以下代码onCreate:
File logFile = new File(LogcatDir.getAbsolutePath() + "/log.txt" );
try
{
Process process = Runtime.getRuntime().exec( "logcat -c");
process = Runtime.getRuntime().exec( "logcat -f " + logFile + " *:S MyActivity_BUT_WHAT_TO_PUT_HERE");
}
catch ( IOException e ) {e.printStackTrace();}
Run Code Online (Sandbox Code Playgroud)
并在manifest file:
<uses-permission android:name="android.permission.READ_LOGS" />
Run Code Online (Sandbox Code Playgroud)
我故意做了解析错误之类的
long test = Long.parseLong("z");
Run Code Online (Sandbox Code Playgroud)
但实际上只有这个log.txt:
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
Run Code Online (Sandbox Code Playgroud)
有谁知道,我有什么代码,我得到整个logcat?
我正在使用MatLab绘制我的数据,现在我有兴趣从中Mathematica获取颜色方案,因为那些MatLab实际上并不是最好的.
有没有办法导入它们MatLab?
如果没有,有没有办法让类似的配色方案,如DarkRainbow或彩虹的MatLab?(我讨厌喷气机,MatLab因为一个人看不到黄线)