ce code:Comment peut lancer GlideBitmapDrawable à BitmapDrawable reciprocaly
imageView = (ImageView) findViewById(R.id.avatar);
Bitmap photo = ((GlideBitmapDrawable)imageView.getDrawable().getCurrent()).getBitmap();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.PNG,100,bos);
byte[] bArray = bos.toByteArray();
retour cette erreur:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable
Merci pour votre aide :)
avez-vous essayé ce post -> https://stackoverflow.com/questions/37701061/android-graphics-drawable-transitiondrawable-cannot-be-cast-to-com- bumptech-glid – slymnozdmrc
En fait j'ai chargé l'image dans ImageView avec Bitmap.createScaledBitmap (bmp, x, y, bool) et maintenant je voudrais le récupérer avec Glide (GlideBitmapDrawable) pour stocker dans le DB –
C'est en partie ce que je veux et réciprocité –