I have a button which presents the choice to user whether he wants the image from gallery or camera. When user takes image from gallery I am able to successfully upload the image to firebase storage, but when user chooses camera, I am not able to upload the image to storage. Here is my onActivityResult code when user chooses camera
if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
selectedImageUri =Uri.parse(data.getExtras().get("data").toString()) ;
Bitmap photo = (Bitmap) data.getExtras().get("data");
cameraImageButton.setImageBitmap(photo);
}
It uploads the image to my imageview, but gives me error saying
No content provider: android.graphics.Bitmap@1b9dbf5f
java.io.FileNotFoundException: No content provider: android.graphics.Bitmap@1b9dbf5f
When I try to upload to storage
I have gone through a similar question posted on stack overflow.
I think the accepted answer is wrong because if I use
mImageUri = data.getData();
mSelectImage.setImageURI(mImageUri);
The above code is only right when you take image from gallery. The image is never uploaded to my imageview if I use above code and take camera image so I am not able to push it to firebase storage. Please help