根据Uri查询图片路径
/**根据Uri获取图片的路径,包含文件名和扩展名*/ String path = null; Uri uri = data.getData(); String[] proj = {MediaStore.Images.Media.DATA}; ContentResolver cr = this.getContentResolver(); Cursor cursor = cr.query(uri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); //最后根据索引值获取图片路径 path = cursor.getString(column_index);