title: Using array list in Recycler view
body: <p>I'm new to recycler view.When I'm adding ArrayList to the custom adapter for RecycleView,it shows "indifferent formal and actual arguments"</p>
  
  <p>My code for CustomAdapter is..</p>
  
  <pre><code>import android.content.Context;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.TextView;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  
  
  public class MenuAdapter extends RecyclerView.Adapter&lt;MenuAdapter.ViewHolder&gt; {
  private String[] mDataset;
  
  ArrayList&lt;HashMap&lt;String ,String&gt;&gt; productList;
  Context myContext;
  
  // 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 static class ViewHolder extends RecyclerView.ViewHolder {
      // each data item is just a string in this case
      public TextView dispname;
      public TextView dispphno;
      public ViewHolder(View v) {
          super(v);
          dispname=(TextView) itemView.findViewById(R.id.dispname);
          dispphno=(TextView)itemView.findViewById(R.id.dispphno);
      }
  }
  
  // Provide a suitable constructor (depends on the kind of dataset)
  public MenuAdapter(ArrayList&lt;HashMap&lt;String,String&gt;&gt; productList) {
  
      this.productList=productList;
      //this.myContext=myContext;
  }
  
  
  // Create new views (invoked by the layout manager)
  @Override
  public MenuAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
                                                   int viewType) {
      // create a new view
      View v = LayoutInflater.from(parent.getContext())
              .inflate(R.layout.menu_card, parent, false);
      // set the view's size, margins, paddings and layout paramete
      ViewHolder vh = new ViewHolder(v);
      return vh;
  }
  
  // Replace the contents of a view (invoked by the layout manager)
  @Override
  public void onBindViewHolder(ViewHolder holder, int position) {
      // - get element from your dataset at this position
      // - replace the contents of the view with that element
      //holder.mTextView.setText(mDataset[position]);
      HashMap&lt;String,String&gt; map=productList.get(position);
      holder.dispname.setText(map.get("name"));
  }
  
  // Return the size of your dataset (invoked by the layout manager)
  @Override
  public int getItemCount() {
      return mDataset.length;
  }
  }
  </code></pre>
  
  <p>The problem is here..</p>
  
  <pre><code>adapter=new MenuAdapter(productsList);
  mRecyclerView.setAdapter(adapter);
  </code></pre>
  
  <p>I initialised the adapter as,</p>
  
  <pre><code>private RecyclerView.Adapter adapter;
  </code></pre>
  
  <p>I get this </p>
  
  <p><img src="https://i.stack.imgur.com/JpjsJ.png" alt="Error while ruuning "></p>