Closed xiaoyan551 closed 6 years ago
点击拍照时如果取消了拍照,会出现一张空白的图片 需要在ImagePickActivity的onActivityResult中判断resultCode != RESULT_OK时删除掉这张图片
`case Constant.REQUEST_CODE_TAKE_IMAGE: if (resultCode == RESULT_OK) {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); File file = new File(mAdapter.mImagePath); Uri contentUri = Uri.fromFile(file); mediaScanIntent.setData(contentUri); sendBroadcast(mediaScanIntent); loadData(); }else { //删除添加的file ,mAdapter.mUri 是将Adapter中创建的图片Uri提到全局并public getApplicationContext().getContentResolver().delete(mAdapter.mUri, null, null); }`
已修改,谢谢
点击拍照时如果取消了拍照,会出现一张空白的图片 需要在ImagePickActivity的onActivityResult中判断resultCode != RESULT_OK时删除掉这张图片
`case Constant.REQUEST_CODE_TAKE_IMAGE: if (resultCode == RESULT_OK) {