android获取返回图片的绝对路径
来源:互联网 发布:剑灵捏脸动漫人物数据 编辑:程序博客网 时间:2024/09/21 08:55
public final static int CONSULT_PICTURE = 100;
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, CONSULT_CAMERA);
if(resultCode==RESULT_OK && requestCode==CONSULT_CAMERA) {
Uri uri = data.getData();if (!TextUtils.isEmpty(uri.getAuthority())) {
//查询选择图片
Cursor cursor = getContentResolver().query(
uri,
new String[] { MediaStore.Images.Media.DATA },
null,
null,
null);
//返回 没找到选择图片
if (null == cursor) {
return;
}
//光标移动至开头 获取图片路径
cursor.moveToFirst();
String path = cursor.getString(cursor
.getColumnIndex(MediaStore.Images.Media.DATA));
//向处理活动传递数据
Toast.makeText(this, path, Toast.LENGTH_SHORT).show();
// Intent intent = new Intent(this, ProcessActivity.class); //主活动->处理活动
// intent.putExtra("path", path);
// //startActivity(intent);
// startActivityForResult(intent, GET_DATA);
}
}
0 0
- android获取返回图片的绝对路径
- android 通过图片的uri来获取图片的绝对路径
- Android根据图片Uri获取图片绝对路径
- Android根据图片Uri获取图片绝对路径
- Android如何获取选择图片时的文件绝对路径方法
- Android根据URI获取图片绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- Android 获取assets的绝对路径
- 关于Android发送邮件
- cocos2d-x -----文件的读取
- PHP中echo()和print_r的区别
- python thrift简单例子
- 关于如何配置IIS服务器
- android获取返回图片的绝对路径
- Day 12: OpenCV —— Java开发者的人脸检测
- 建设网站需要注意的十个SEO技巧
- 关于Andorid的RecyclerView在V7包下找不到的解决办法
- machoview-macho可视化工具
- PAT 1015德才论
- easyui-combo下拉框
- 关于网站内连的重要性和如何做内部链接?
- C++中new的用法