File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
storage/app/src/main/java/com/google/firebase/referencecode/storage Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 1717package com .google .firebase .referencecode .storage ;
1818
1919import android .graphics .Bitmap ;
20+ import android .graphics .drawable .BitmapDrawable ;
2021import android .net .Uri ;
2122import android .os .Bundle ;
2223import android .support .annotation .NonNull ;
@@ -168,7 +169,7 @@ private void includesForUploadFiles() throws FileNotFoundException {
168169 // Get the data from an ImageView as bytes
169170 imageView .setDrawingCacheEnabled (true );
170171 imageView .buildDrawingCache ();
171- Bitmap bitmap = imageView .getDrawingCache ();
172+ Bitmap bitmap = (( BitmapDrawable ) imageView .getDrawable ()). getBitmap ();
172173 ByteArrayOutputStream baos = new ByteArrayOutputStream ();
173174 bitmap .compress (Bitmap .CompressFormat .JPEG , 100 , baos );
174175 byte [] data = baos .toByteArray ();
You can’t perform that action at this time.
0 commit comments