I have an activity in which I use 2 resources:
1 round image, like this:
String image = dataSnapshot.child("thumb_image").getValue().toString();
Picasso.with(pilotProfileImage.getContext()).load(image)
.placeholder(R.drawable.pilot_default).into(pilotProfileImage);
When thumb_image is a picture stored in Firebase Storage.
Another resource:
mImage.setBackgroundResource(R.drawable.m_air);
While R.drawable.m_air
is a drawable saved in my drawable folder
I'm receiving
java.lang.OutOfMemoryError: Failed to allocate a 14745612 byte allocation with 10530520 free bytes and 10MB until OOM
I've seen solution with Bitmap
but I'm not using bitmap here.
I've tried
mDroneImage.setImageBitmap(decodeSampledBitmapFromResource(getResources(), R.drawable.mavic_air, 100, 100))
In this solution: Strange out of memory issue while loading an image to a Bitmap object
but the app still crashes. In addition it doesn't solve the firebase image problem.
How can I solve it?
Edit: Found answers for the firebase problem in the docs: https://github.com/codepath/android_guides/wiki/Displaying-Images-with-the-Picasso-Library