title: Populate recyclerview with a SQLite database?
body: <p>There's nothing wrong with the typical android cursor. But I'm still confused on how to implement it, does anyone here have an example or does anyone have another easier solution?</p>
  
  <p><strong>My Recyclerview Adapter</strong></p>
  
  <pre><code>    public class WatchlistAdapter extends RecyclerView.Adapter&lt;WatchlistAdapter.MyViewHolder&gt; {
  
      private LayoutInflater mInflater ;
      ArrayList&lt;Games&gt; data = new ArrayList&lt;&gt;(); //a way so it never equals null
      private int position;
  
      public WatchlistAdapter(Context context, ArrayList&lt;Games&gt; mData){
          mInflater = LayoutInflater.from(context);
          data = mData;
      }
  
      //called every time
      @Override
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = mInflater.inflate(R.layout.watchlist_item, parent, false);
          MyViewHolder holder = new MyViewHolder(view);
          return holder;
      }
  
      @Override
      public void onBindViewHolder(final MyViewHolder holder, final int position) {
          Games currentGame= data.get(position);
          holder.gameTitle.setText(currentGame.get_name());
          holder.releasedate.setText(currentGame.get_releaseDate());
          holder.platform.setText(currentGame.get_platform());
  
          //to capture the position before the context menu is loaded:
          holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
              @Override
              public boolean onLongClick(View v) {
                  setPosition(holder.getPosition());
                  return false;
              }
          });
      }
  
      public int getItemPosition(){
          return position;
      }
  
      public void setPosition(int position){
          this.position = position;
      }
  
  
      @Override
      public int getItemCount() {
          return data.size();
      }
  
      static class MyViewHolder extends RecyclerView.ViewHolder implements View.OnCreateContextMenuListener{
          private TextView gameTitle;
          private TextView releasedate;
          private TextView platform;
          public MyViewHolder(View itemView) {
              super(itemView);
              gameTitle = (TextView) itemView.findViewById(R.id.gameTitle);
              releasedate = (TextView) itemView.findViewById(R.id.releasedateText);
              platform = (TextView) itemView.findViewById(R.id.platformText);
              itemView.setOnCreateContextMenuListener(this);
          }
  
          @Override
          public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
              MenuInflater inflater = new MenuInflater(v.getContext());
              inflater.inflate(R.menu.context_menu, menu);
          }
      }
  }
  </code></pre>