外部存储不装入 [英] External Storage Not Mounted
问题描述
我还是很新的Android开发。我试图用相机拍照,并将其保存到存储设备。这个应用程序崩溃和调试后,我意识到这是因为设备的外部存储设备未安装。我该如何处理呢?我可以装入存储或者是我的应用程序只是无法将数据存储到特定设备上?
I am still quite new to Android development. I'm trying to take a photo using the camera and save it to the devices storage. The app was crashing and after debugging I realised it's because the devices external storage is not mounted. How do I handle this? Can I mount the storage or is my app just unable to store data on this particular device?
感谢
更新:
有被选为这个问题的答案,但它似乎已被删除...这我挂这些文档:的 http://developer.android.com/reference/android/os/Environment.html
There was an answer chosen to this question but it seems to have been deleted... It linked me to these docs: http://developer.android.com/reference/android/os/Environment.html
推荐答案
请确保您使用的是Environment.getExternalStorageDirectory()和不硬codeD字符串。
Make sure you are using Environment.getExternalStorageDirectory() and not hard coded strings.
有些系统使用/ SD卡和一些到/ mnt / SD卡,甚至到/ mnt / sdcard2 ..因为你没有张贴任何code,我不能肯定这是否解决了问题。
Some systems use /sdcard and some /mnt/sdcard or even /mnt/sdcard2.. Since you didn't post any code I cannot be sure if this solves the issue.
<一个href=\"http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29\" rel=\"nofollow\">http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29
这篇关于外部存储不装入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!