new Runnable() {
public void run() {
try {
//Bitmap bitmap = Picasso.with(getActivity()).load(Uri.parse(mNewMember.getMemberImageUri())).resize(300, 300).get();
Bitmap bitmap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), Uri.parse(mNewMember.getMemberImageUri()));
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 10, stream);
byte[] imageData = stream.toByteArray();
FirebaseStorage.getInstance().getReference()
.child("member images\\")
.child(mNewMember.getMemberId() + ".jpg").putBytes(imageData);
}catch (IOException e){Log.d("db","machhar");}
}
}.run();
So currently it is uploading an image to firebase storeage but if I uncomment the commented line and comment the line below it, then the image does not get uploaded and no error gets generated i also tried attaching failure listener , it also does not get called. While both the lines returns a bitmap then why the first line(commented) does not work , and second line works. Also if I use the first line I have to run it one a background thread otherwise it produces error.
Please explain