title: setAdapter in recyclerView cannot be applied
body: <p>So I followed an online tutorial to have a sort of gallery app. The pictures are shown inside a GridView but I needed to change it into a recyclerview. When I do that though I get that error and my adapter doesn't seem to work with the recyclerview. Here is my adapter code: </p>
  
  <pre><code>    class AlbumAdapter extends BaseAdapter {
          private Activity activity;
          private ArrayList&lt;HashMap&lt; String, String &gt;&gt; data;
          public AlbumAdapter(Activity a, ArrayList &lt; HashMap &lt; String, String &gt;&gt; d) {
              activity = a;
              data = d;
          }
          public int getCount() {
              return data.size();
          }
          public Object getItem(int position) {
              return position;
          }
          public long getItemId(int position) {
              return position;
          }
  
          public View getView(int position, View convertView, ViewGroup parent) {
              AlbumViewHolder holder = null;
              if (convertView == null) {
                  holder = new AlbumViewHolder();
                  convertView = LayoutInflater.from(activity).inflate(
                          R.layout.album_row, parent, false);
  
                  holder.galleryImage = (ImageView) convertView.findViewById(R.id.galleryImage);
                  holder.gallery_count = (TextView) convertView.findViewById(R.id.gallery_count);
                  holder.gallery_title = (TextView) convertView.findViewById(R.id.gallery_title);
  
                  convertView.setTag(holder);
              } else {
                  holder = (AlbumViewHolder) convertView.getTag();
              }
              holder.galleryImage.setId(position);
              holder.gallery_count.setId(position);
              holder.gallery_title.setId(position);
  
              HashMap &lt; String, String &gt; song = new HashMap &lt; String, String &gt; ();
              song = data.get(position);
              try {
                  holder.gallery_title.setText(song.get(Function.KEY_ALBUM));
                  holder.gallery_count.setText(song.get(Function.KEY_COUNT));
  
                  Glide.with(activity)
                          .load(new File(song.get(Function.KEY_PATH))) // Uri of the picture
                          .into(holder.galleryImage);
  
  
              } catch (Exception e) {}
              return convertView;
          }
      }
      class AlbumViewHolder {
          ImageView galleryImage;
          TextView gallery_count, gallery_title;
      }
  </code></pre>
  
  <p>And this is some of the code from the activity in which I set my adapter:</p>
  
  <pre><code>@Override
      protected void onPostExecute(String xml) {
  
          AlbumAdapter adapter = new AlbumAdapter(ProfileActivity.this, albumList);
          galleryGridView.setAdapter(adapter);
          galleryGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                      final int position, long id) {
                  Intent intent = new Intent(ProfileActivity.this, AlbumActivity.class);
                  intent.putExtra("name", albumList.get(+position).get(Function.KEY_ALBUM));
                  startActivity(intent);
              }
          });
      }
  </code></pre>
  
  <p>This is the error I'm currently getting:
  <a href="https://i.stack.imgur.com/aLaz5.png" rel="nofollow noreferrer">Error message </a></p>
  
  <p>I basically want to fix the adapter so that it works inside a recyclerview.</p>