title: add volley Jsonobjects to CardView and add cardView to RecyclerView
body: <p>I'm trying to add Jsonobjects which i have parsed using volley from network and then add that card view to a recyclerView, but when I do so i got NullPointerException.
  my search.java:</p>
  
  <pre><code>public class search extends AppCompatActivity {
      public RecyclerView recyclerView;
      RequestQueue requestQueue;
      itemsAdapter itemsAdapter;
      @Override
      protected void attachBaseContext(Context newBase) {
          super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_search);
          String url = "http://dl.naserpour.ir/WEBSERVICE/KETABSARA/all.php";
          recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
          recyclerView.setLayoutManager(new LinearLayoutManager(this));
          requestQueue = Volley.newRequestQueue(this);
          JsonArrayRequest req = new JsonArrayRequest(url, new Response.Listener&lt;JSONArray&gt;() {
              @Override
              public void onResponse(JSONArray response) {
                  final List&lt;items&gt; items = new ArrayList&lt;&gt;();
                  for (int i = 0; i &lt;= response.length(); i++) {
                      try {
                          JSONObject obj = response.getJSONObject(i);
                          String NAME = obj.getString("name");
                          String WRITER = obj.getString("writer");
                          String IMAGE = "http://dl.naserpour.ir/WEBSERVICE/KETABSARA/upload/images/images" + obj.getString("img");
                          items.add(new items(NAME, WRITER, IMAGE));
  
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
                      itemsAdapter = new itemsAdapter(items);
                  }
                  recyclerView.setAdapter(itemsAdapter);
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
  
              }
          });
          requestQueue.add(req);
  
      }
  
      public class items {
          private String name, writer, image;
  
          public items(String name, String writer, String image) {
              this.name = name;
              this.writer = writer;
              this.image = image;
          }
      }
  
      private class itemHolder extends RecyclerView.ViewHolder {
          private TextView searchname, searchwriter;
          private ImageView searchimage;
          public itemHolder(View itemView) {
              super(itemView);
              searchimage = (ImageView)findViewById(R.id.searchimage);
              searchname = (TextView)findViewById(R.id.searchname);
              searchwriter = (TextView)findViewById(R.id.searchwriter);
  
          }
  
      }
  
      private class itemsAdapter extends RecyclerView.Adapter&lt;itemHolder&gt; {
          private List&lt;items&gt; items;
  
          public itemsAdapter(List&lt;items&gt; items) {
              this.items = items;
          }
  
          @Override
          public itemHolder onCreateViewHolder(ViewGroup parent, int viewType) {
              LayoutInflater inflater = LayoutInflater.from(search.this);
              View v = inflater.inflate(R.layout.searchlist, parent, false);
              return new itemHolder(v);
          }
  
          @Override
          public void onBindViewHolder(final itemHolder holder, int position) {
              items item = items.get(position);
              holder.searchname.setText(item.name);
              holder.searchwriter.setText(item.writer);
              ImageRequest req = new ImageRequest(item.image, new Response.Listener&lt;Bitmap&gt;() {
                  @Override
                  public void onResponse(Bitmap response) {
                      holder.searchimage.setImageBitmap(response);
                  }
              }, 0, 0, ImageView.ScaleType.CENTER_CROP, Bitmap.Config.ARGB_8888, new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      error.printStackTrace();
                  }
              });
              requestQueue.add(req);
          }
  
          @Override
          public int getItemCount() {
              return items.size();
          }
      }
  }
  </code></pre>
  
  <p>my layout:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:orientation="vertical"
      android:layoutDirection="rtl"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="ir.naserpour.ketabsara.search"&gt;
  
      &lt;EditText
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/search"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:background="@drawable/shape"
          android:hint="جستجو"
          android:drawableLeft="@android:drawable/ic_menu_search"
          android:paddingLeft="15dp"
          android:paddingRight="15dp" /&gt;
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recyclerview"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>my searchlist layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:layoutDirection="rtl"&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="180dp"&gt;
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="horizontal"&gt;
              &lt;ImageView
                  android:layout_width="120dp"
                  android:layout_height="match_parent"
                  android:id="@+id/searchimage"
                  android:scaleType="centerCrop" /&gt;
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:orientation="vertical"
                  android:gravity="center_vertical"
                  android:paddingRight="10dp"&gt;
  
                  &lt;TextView
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:text=""
                      android:id="@+id/searchname"
                      android:layout_weight="1"
                      android:gravity="center_vertical|right" /&gt;
  
                  &lt;TextView
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:text=""
                      android:id="@+id/searchwriter"
                      android:layout_weight="1"
                      android:gravity="center_vertical|right" /&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.v7.widget.CardView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>my logcat(errors are on lines 112, 129):</p>
  
  <pre><code>Process: ir.naserpour.ketabsara, PID: 15311
  java.lang.NullPointerException
      at ir.naserpour.ketabsara.search$itemsAdapter.onBindViewHolder(search.java:129)
      at ir.naserpour.ketabsara.search$itemsAdapter.onBindViewHolder(search.java:112)
      at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:5471)
      at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:5504)
      at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4741)
      at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4617)
  </code></pre>
  
  <p>can you please help me with this?</p>