title: Android loading image with volley + recyclerView
body: <p>I'm trying to load images in a <code>RecyclerView</code>.</p>
  
  <p>It's working alright until I scroll left and right (horizontal <code>RecyclerView</code>), some pictures disappear (the one at the edges) with the following error : </p>
  
  <blockquote>
    <p>Volley: [3267] NetworkDispatcher.run: Unhandled exception java.lang.IllegalArgumentException: width and height must be > 0</p>
  </blockquote>
  
  <p>Now here is my adapter class (I believe the problem is here) :</p>
  
  <pre><code>package com.rezadiscount.rezadiscount.adapter;
  
  import android.content.Context;
  import android.support.v7.widget.RecyclerView;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.LinearLayout;
  
  import com.android.volley.toolbox.NetworkImageView;
  import com.rezadiscount.rezadiscount.R;
  import com.rezadiscount.rezadiscount.activities.FragmentBusinessProfile;
  import com.rezadiscount.rezadiscount.utilities.HTTPVolleyRequest;
  import com.rezadiscount.rezadiscount.utilities.QuickstartPreferences;
  
  import java.util.ArrayList;
  
  //TODO Images disappear in list
  
  /**
   * Adapter of finding a business by category
   */
  public class BusinessPictureAdapter extends RecyclerView.Adapter&lt;BusinessPictureAdapter.CategoryViewHolder&gt; {
      private ArrayList&lt;String&gt; businessPictureList;
      private Context con;
  
      // Provide a suitable constructor (depends on the kind of dataset)
      public BusinessPictureAdapter(ArrayList&lt;String&gt; businessPictureListP, Context conP) {
          con = conP;
          businessPictureList = businessPictureListP;
      }
  
      // Create new views (invoked by the layout manager)
      @Override
      public BusinessPictureAdapter.CategoryViewHolder onCreateViewHolder(ViewGroup parent,
                                                                          int viewType) {
          // create a new view
          View v = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.business_picture_item, parent, false);
          // set the view's size, margins, paddings and layout parameters
  
          return new CategoryViewHolder((LinearLayout) v);
      }
  
      // Replace the contents of a view (invoked by the layout manager)
      @Override
      public void onBindViewHolder(CategoryViewHolder holder, int position) {
          // - get element from your dataset at this position
          // - replace the contents of the view with that element
          holder.imageView.setImageUrl(QuickstartPreferences.URL_IMAGES + businessPictureList.get(position), HTTPVolleyRequest.getInstance(con).getImageLoader());
  
          Log.d("CardView Text", "Image url" + QuickstartPreferences.URL_IMAGES + businessPictureList.get(position));
  
          //holder.currentItem = items.get(position);
  
      }
  
      // Return the size of your dataset (invoked by the layout manager)
      @Override
      public int getItemCount() {
          return businessPictureList.size();
      }
  
      @Override
      public void onAttachedToRecyclerView(RecyclerView recyclerView) {
          super.onAttachedToRecyclerView(recyclerView);
      }
  
      // Provide a reference to the views for each data item
      // Complex data items may need more than one view per item, and
      // you provide access to all the views for a data item in a view holder
      public class CategoryViewHolder extends RecyclerView.ViewHolder {
          // each data item is just a string in this case
          public NetworkImageView imageView;
  
          public CategoryViewHolder(LinearLayout v) {
              super(v);
              imageView = (NetworkImageView) v.findViewById(R.id.business_picture);
  
              v.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                  }
              });
          }
      }
  }
  </code></pre>
  
  <p>Note : I've googled it and couldn't solve the problem so far. Any help is highly appreciated.</p>