title: Recyclerview adapter with asyncTask
body: <p>I'm trying to use custom adapter with <code>RecyclerView</code>, but the holders are empty. I can't understand what did i miss. Please help.</p>
  
  <p>In MainActivity's AsyncTask:</p>
  
  <pre><code>@Override
      protected void onPostExecute(String result) {
          json_result = result;
          super.onPostExecute(result);
          dialog.dismiss();
          if (result == null) {
              Toast.makeText(MainActivity.this, "error getting results...", Toast.LENGTH_LONG).show();
  
          } else {
  
              try {
                  JSONObject json = new JSONObject(result);
                  Log.e(TAG, "create json object");
  
                  JSONArray searchArray = json.getJSONArray("Search");
                  Log.e(TAG, "Search");
  
                  for (int i = 0; i &lt; searchArray.length(); i++) {
                      Log.e(TAG, "run on length");
                      JSONObject searchObject = searchArray.getJSONObject(i);
                      Log.e(TAG, "create search object");
                      String title = searchObject.getString("Title");
                      Log.e(TAG, "Title" + title);
                      String type = searchObject.getString("Type");
                      Log.e(TAG, "Type" + type);
                      String year = searchObject.getString("Year");
                      Log.e(TAG, "Year" + year);
                      String imdbID = searchObject.getString("imdbID");
                      String poster = searchObject.getString("Poster");
                      Log.e(TAG, "" + result);
                      movieList.add(new Movie(title, type, year, imdbID, poster));
                      Log.e(TAG, "Add to adapter");
  
  
                  }
              } catch (JSONException e) {
                  e.printStackTrace();
                  Toast.makeText(MainActivity.this, "error parsing results...", Toast.LENGTH_LONG).show();
              }
  
              adapter.notifyDataSetChanged();
              Log.e(TAG, "Notify");
  
          }
      }
  </code></pre>
  
  <p>Custom Adapter:</p>
  
  <pre><code>public class Adapter extends
      RecyclerView.Adapter&lt;Adapter.ViewHolder&gt; {
  private LruCache&lt;String, Bitmap&gt; bitmapCache;
  Context context;
  
  
  public static class ViewHolder extends RecyclerView.ViewHolder {
      public TextView title;
      public TextView year;
      public TextView type;
      public ImageView poster;
  
      public ViewHolder(View itemView) {
          super(itemView);
          title = (TextView) itemView.findViewById(R.id.txt_title);
          year = (TextView) itemView.findViewById(R.id.txt_year);
          type = (TextView) itemView.findViewById(R.id.txt_rating);
          poster = (ImageView) itemView.findViewById(R.id.imageView);
  
      }
  
  }
  
  private List&lt;Movie&gt; mList;
  
  public Adapter(List&lt;Movie&gt; mList) {
      this.mList = mList;
      int numImages = 4 * 1024 * 1024;
      this.bitmapCache = new LruCache&lt;String, Bitmap&gt;(numImages) {
          @Override
          protected int sizeOf(String key, Bitmap value) {
              // this is how to calculate a bitmap size in bytes.
              // (bytes-in-a-row * height)
              return value.getRowBytes() * value.getHeight();
          }
      };
  }
  
  @Override
  public Adapter.ViewHolder onCreateViewHolder
          (ViewGroup parent, int viewType) {
      Context context = parent.getContext();
      LayoutInflater inflater = LayoutInflater.from(context);
      View movieView = inflater.inflate(R.layout.card_view, parent, false);
      ViewHolder viewHolder = new ViewHolder(movieView);
  
  
  
  
      return viewHolder;
  }
  
  @Override
  public void onBindViewHolder
          (Adapter.ViewHolder holder, int position) {
      Movie movie = mList.get(position);
      holder.title.setText(movie.getTitle());
      holder.year.setText(movie.getYear());
      holder.type.setText(movie.getType());
      holder.poster.setVisibility(View.INVISIBLE);
      GetImageTask task = new GetImageTask(movie, holder);
      task.execute(movie.getPoster_url());
  
  }
  
  @Override
  public int getItemCount() {
      return mList.size();
  }
  
  class GetImageTask extends AsyncTask&lt;String, Void, Bitmap&gt; {
  
  
      private final Movie movie;
      private final ViewHolder holder;
  
      public GetImageTask(Movie movie, ViewHolder holder) {
          this.movie = movie;
          this.holder = holder;
      }
  
      @Override
      protected Bitmap doInBackground(String... params) {
          //download:
          String address = params[0];
          Bitmap bitmap = HttpHandler.getBitmap(address, null);
  
          //save it in the cache for later:
          if (bitmap != null) {
              bitmapCache.put(address, bitmap);
          }
          return bitmap;
      }
  
      @Override
      protected void onPostExecute(Bitmap result) {
  
          if (movie.equals(holder.poster)) {
              holder.poster.setVisibility(View.VISIBLE);
              holder.poster.setImageBitmap(result);
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I think the problem is that my movie class is empty, but i do have JSON results in asynctask... </p>