在onactivityForResult里面做一下处理即可。
if (data != null) { Bundle extras = data.getExtras(); if (GeneralUtils.isEmpty(extras)) { LogUtils.debug("extras为空" + data); Uri uri = data.getData(); if (uri != null) { head = BitmapFactory.decodeFile(uri.getPath()); setPicToView(head);// 保存在SD卡中 } return; } head = extras.getParcelable("data"); if (head != null) { /** * 上传服务器代码 */ setPicToView(head);// 保存在SD卡中 }