uri以content开始,从uri获取文件路径
2015-12-30 10:38
274 查看
private String getRealPathFromURI(Uri contentUri) { String[] proj = { MediaStore.Images.Media.DATA }; CursorLoader loader = new CursorLoader(getApplicationContext(), contentUri, proj, null, null, null); Cursor cursor = loader.loadInBackground(); int column_index = cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); }
相关文章推荐
- 新人三年怎么成总监?
- vboot小内核打印
- bootstrap-model(对话框)打开关闭事件监听
- HTML5块级元素
- 转帖:Android 官方推荐 : DialogFragment 创建对话框
- js中的apply 和 call
- mac 上的版本控制工具SmartSVN9.0.4(破解版)
- error nr.1045 access denied for user 'root'@'localhost' (using passwd:no)
- Java 实现导出excel表
- mysql在windows下主从同步配置
- 省选模拟考试1
- 常用的字符串截取
- scanf正则表达式
- BinaryReader 、BinaryWriter是方便用二进制方式读写int,double,string之类的数据
- JavaScript RegExp.$1...$9 属性详解
- Activiti 5.17 实体对象、类、数据库表的映射
- Java 实现导出excel表 POI
- LeetCode:110. Balanced Binary Tree
- Java实现截图并保存到本地
- 《从零开始学Swift》学习笔记(Day54)——抛出错误