我想让用户选择将视频文件存储在sdcard0(内部存储器)或sdcard1中。我怎样才能做到这一点。 Environment.getExternalStorageDirectory()和Environment.getExternalPublicStorageDirectory()将文件保存在sdcard1中。如何在sdcard0中保存文件?
答案 0 :(得分:0)
试试此代码
p = re.compile('data-reveal=*')
答案 1 :(得分:0)
ContextWrapper contextWrapper = new ContextWrapper(
getApplicationContext());
File directory = contextWrapper.getDir(filepath,Context.MODE_PRIVATE);
myInternalFile = new File(directory, filename);
try {
FileOutputStream fos = new FileOutputStream(myInternalFile); // save
fos.write(myInputText.getText().toString().getBytes());
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
myInputText.setText("");
responseText.setText("Saved to Internal Storage.(StorageFile.txt)");