为什么getExternalFilesDir将我的文件保存到内部存储

时间:2017-06-11 11:50:11

标签: android

我刚刚开始开发Android应用程序,所以我需要你的帮助。

这是我的代码。

GENERAL: MPEG-TS: 2.93 MiB, 9s 960ms; 1 Video stream: MPEG Video; 1 Menu stream: MPEG Video; Overall bit rate mode: Variable; Overall bit rate: 2 465 Kbps; 
VIDEO: 2 343 Kbps, 1280*800(16:10), at 25.000 fps, MPEG Video (Version 2) (Main@High 1440)

但我的临时文件始终在内部存储中创建,而不是在外部存储中创建。

2 个答案:

答案 0 :(得分:0)

File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);

我相信这一行你要求为用户列出的图片目录。尝试改为使用null,如下所示:

File storageDir = getExternalFilesDir(null);

如果这对您有用,请告诉我!祝你好运!

答案 1 :(得分:0)

//使用此代码更改可将您的数据存储在外部存储中

File storageDir = getExternalFilesDir("Pictures");