读取外部存储文件 [英] read file from external storage

查看:164
本文介绍了读取外部存储文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根本无法找到如何从外部存储得到一个指定的文件。 我知道,与getExternalStoragePublicDirectory(),你得到的外部存储目录,但我不能得到进一步提高。我需要一种方法,你必须给文件的名称,它返回的文件。 感谢名单

I simply cannot find how to get one specified file from the external storage. I know that with getExternalStoragePublicDirectory(), you get the external storage directory but I can't get further. I need some kind of method where you have to give the name of the file and it returns the file. Thanx

推荐答案

比使用更好的文件分割符是这样的,这是标准的Java:

Better than using File.separator is this, which is standard Java:

final File file = new File(Environment.getExternalStorageDirectory()
                          .getAbsolutePath(), filename);

这篇关于读取外部存储文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆