eshteghel company eshteghel company - 3 days ago 6
Android Question

Out of Memory Error Image Loader

I have this application that loads images from a web service using the image loader 1.9.3 library and with having phones with low memory the image loader gives out of memory exception that is only visible in the log cat. I don't mind the exception but i want the exception to be visible to the user via a toast so that he knows why the images stopped loading.
Any ideas please

Answer

your images are too big compared to size of your ImageView.

I recommend you to use Picasso.

with this you can Resize your Image according to your need.

Picasso.with(this).load(image_link)
    .resize(100, 100)
    .placeholder(R.drawable.placeholder)
    .error(R.drawable.placeholder)
    .into(imageView);

Happy Coding.

Comments