title: Unable to set up Recycler View
body: <p>I have been using ListView all this time and trying out Recycler view now. Been trying to follow the documentation for the basic setup but frustratingly unable to do so. </p>
  
  <p>The ViewHolder class is supposed to take in a TextView parameter but in the documentation site, the example is inputting a View as a parameter and I don't get how that is supposed to work. I tried to cast it with TextView and get a ClassCastException. I have commented above the line which gives error preventing me from compiling. Error is in MyAdapter Class.     </p>
  
  <p>I apologize if I am just bad at reading documents, otherwise plain ridiculous for this to come from an official site. <a href="http://developer.android.com/training/material/lists-cards.html" rel="nofollow">Official page</a></p>
  
  <p>MainActivity</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private RecyclerView mRecyclerView;
      private RecyclerView.Adapter mAdapter;
      private RecyclerView.LayoutManager mLayoutManager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
          mRecyclerView.setHasFixedSize(true);
  
          mLayoutManager = new LinearLayoutManager(this);
          mRecyclerView.setLayoutManager(mLayoutManager);
  
          String[] myDataset = {"item 1", "item 2"};
  
          mAdapter = new MyAdapter(myDataset);
          mRecyclerView.setAdapter(mAdapter);
      }
  }
  </code></pre>
  
  <p>MyAdapter Class</p>
  
  <pre><code>import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  public class MyAdapter extends RecyclerView.Adapter&lt;MyAdapter.ViewHolder&gt; {
      private String[] mDataset;
  
      public static class ViewHolder extends RecyclerView.ViewHolder {
          public TextView mTextView;
          public ViewHolder(TextView v) {
              super(v);
              mTextView = v;
          }
      }
  
      public MyAdapter(String[] myDataset) {
          mDataset = myDataset;
      }
  
      @Override
      public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
                                                     int viewType) {
          View v = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.my_text_view, parent, false);
  
          //THIS is the line causing error. v is View. I should be inputting a textview. 
          ViewHolder vh = new ViewHolder(v);
  
          return vh;
      }
  
      @Override
      public void onBindViewHolder(ViewHolder holder, int position) {
          holder.mTextView.setText(mDataset[position]);
      }
  
      @Override
      public int getItemCount() {
          return mDataset.length;
      }
  
  }
  </code></pre>
  
  <p>my textview xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:id="@+id/textView" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>