@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.e("TAG", "---requestCode-" + requestCode + "---resultCode--" + resultCode); // 根据选择完毕的图片返回值,直接上传文件 if (requestCode == 1) { // 拍照 String localStrPath = photoFile.getPath(); byte[] compressBitmap = BitmapUtils.compressBitmap(480 * 480, localStrPath); if (null != compressBitmap) { Bitmap bmPhoto = BitmapUtils.Bytes2Bimap(compressBitmap); if (null != bmPhoto) { String strTempPhotoPath; try { strTempPhotoPath = BitmapUtils.saveFile(bmPhoto, UUID.randomUUID() + ".jpeg"); if (bmPhoto != null) { bmPhoto.recycle(); bmPhoto = null; } if (null != strTempPhotoPath && !"".equals(strTempPhotoPath)) { localStrPath = strTempPhotoPath; } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } localStrPath = "file://" + localStrPath; Uri pathUri = Uri.parse(localStrPath); mUploadHandler.post(new MyRunnable(pathUri)); } } }