```java
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data, ContentResolver cr) {
if (resultCode == RESULT_OK) {
Bitmap mBitmap = null;
if (requestCode == REQUEST_CAMERA) {
Bundle bundle = data.getExtras();
mBitmap = bundle.getParcelable("data");
} else if (requestCode == REQUEST_PHOTO_ALBUM) {
Uri uri = data.getData();
if (uri != null) {
try {
mBitmap = MediaStore.Images.Media.getBitmap(cr, uri);
} catch (IOException e) {
e.printStackTrace();
}
} else {
Bundle bundle = data.getExtras();
mBitmap = bundle.getParcelable("data");
}
}
mView.setCivAvatarImageView(mBitmap);
upload(mBitmap);
}
}