0

I am facing an issue similar to the one in this post. I am using volley library to load only images into my (horizontal) recyclerview adapter. But I get a runtime exception every time I swipe the view to the left or right. I can use picasso but i want to know what the real problem is!

Logcat

 E/Volley: [187] NetworkDispatcher.run: Unhandled exception java.lang.IllegalArgumentException: width and height must be > 0
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:829)
at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
at android.graphics.Bitmap.createBitmap(Bitmap.java:739)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:615)
at com.android.volley.toolbox.ImageRequest.doParse(ImageRequest.java:202)
at com.android.volley.toolbox.ImageRequest.parseNetworkResponse(ImageRequest.java:159)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:123)

I have implemented singletonRequestQueue as mentioned in the android documentation.

the image loading code snippet in recyclerAdapter

imageLoader = SingletonRequestQueue.getInstance(mContext).getImageLoader();
        String URL = Images.get(position);
        holder.itemImage.setImageUrl(URL, imageLoader);

Any help would be appriciated. Thanks!

Community
  • 1
  • 1
Vedant Aggrawal
  • 400
  • 4
  • 17

0 Answers0