title: Difficulty following Android "Creating List and Cards tutorial"
body: <p>I am trying to follow <a href="https://developer.android.com/training/material/lists-cards.html" rel="nofollow">this</a> tutorial. </p>
  
  <p>Google give the following code:</p>
  
  <pre><code>public class MyAdapter extends RecyclerView.Adapter&lt;MyAdapter.ViewHolder&gt; {
      private String[] mDataset;
  
      // 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 mTextView;
          public ViewHolder(TextView v) {
              super(v);
              mTextView = v;
          }
      }
  
      // Provide a suitable constructor (depends on the kind of dataset)
      public MyAdapter(String[] myDataset) {
          mDataset = myDataset;
      }
  
      // Create new views (invoked by the layout manager)
      @Override
      public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
                                                     int viewType) {
          // create a new view
          View v = LayoutInflater.from(parent.getContext())
                                 .inflate(R.layout.my_text_view, parent, false);
          // set the view's size, margins, paddings and layout parameters
          ...
          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]);
  
      }
  
      // Return the size of your dataset (invoked by the layout manager)
      @Override
      public int getItemCount() {
          return mDataset.length;
      }
  }
  </code></pre>
  
  <p>I am trying to make this work exactly as the example. I have created a my_text_view.xml file which looks as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent" android:layout_height="match_parent"
      android:text="testing"
      /&gt;
  </code></pre>
  
  <p>However, I receive an error on this line:</p>
  
  <pre><code>TextView v = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.my_text_view, parent, false);
  </code></pre>
  
  <p>that Required is a android.widget.TextView and that I have given an android.view.View</p>
  
  <p>I must be misunderstanding how to pass a textView. Usually I would use (TextView) R.FindViewById however as the tutorial is grabbing it from layout I don't think it wants me to do this.</p>
  
  <p>Would really appreciate some help understanding this. </p>