选择图片并裁剪后,如何将当前用户个人资料图片更新到 firebase?
这是我的代码:
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CropImage.PICK_IMAGE_CHOOSER_REQUEST_CODE && resultCode == RESULT_OK){
Uri imageUri = CropImage.getPickImageResultUri(getActivity(),data);
cropRequest(imageUri);
}
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE){
CropImage.ActivityResult result = CropImage.getActivityResult(data);
if (resultCode == RESULT_OK){
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), result.getUri());
imgUserProfile.setImageBitmap(bitmap);
final ProgressDialog pd = new ProgressDialog(getContext());
pd.setMessage("Please wait ");
pd.show();
} catch (IOException e){
e.printStackTrace();
}
}
}
}
我如何从那里继续?有什么建议么?
HUX布斯
慕运维8079593
相关分类