摘要:
两种文件的区别公共文件: 1.可以被其它程序和用户访问。 2.当程序被卸载时,不会被系统删除。私有文件: 1.只能被拥有它的程序访问。 2.当程序被卸载时,会被系统删除。公共文件代码例子:1 public File getAlbumStorageDir(String albumName) {2 // Get the directory for the user's public pictures directory. 3 File file = new File(Environment.getExternalStoragePublicDirectory(4 ... 阅读全文
posted @ 2013-05-10 11:52
Agrimony
阅读(425)
评论(0)
推荐(0)
摘要:
通过调用Environment的getExternalStorageState()方法来判断外部存储的状态:/* 查检外部存储读取与写入功能是否可用 */public boolean isExternalStorageWritable() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { return true; } return false;}/*查检外部存储读取功能是否可用 */public boo... 阅读全文
posted @ 2013-05-10 11:24
Agrimony
阅读(664)
评论(0)
推荐(0)