title: Add EditText to Recycler
body: <p>I am new to android RecyclerView and it gives Error while i tried to add the Edittext fields to Recycler.I cannot find how to do this. Anyone please solve this issue and thanks in advance :) :) This is my mainactivity Code:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity{
  
  private RecyclerView mRecyclerView;
  private CustomRecyclerAdapter mAdapter;
  private RecyclerView.LayoutManager mLayoutManager;
  
  private EditText mText;
  private EditText mColor;
  
  private List&lt;Data&gt; mData = new ArrayList&lt;&gt;();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      // Initializing views.
      mText = (EditText) findViewById(R.id.textEt);
  
      mRecyclerView = (RecyclerView) findViewById(R.id.recycler);
  
      // If the size of views will not change as the data changes.
      mRecyclerView.setHasFixedSize(true);
  
      // Setting the LayoutManager.
      mLayoutManager = new LinearLayoutManager(this);
      mRecyclerView.setLayoutManager(mLayoutManager);
  
      // Setting the adapter.
      mAdapter = new CustomRecyclerAdapter();
      mRecyclerView.setAdapter(mAdapter);
  }
  
  // Called when add button is clicked.
  public void addItem(View view) {
  
      // Add data locally to the list.
      Data dataToAdd = new Data(
              mText.getText().toString());
      mData.add(dataToAdd);;
  
      // Update adapter.
      mAdapter.addItem(mData.size() - 1, dataToAdd);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The CustomRecyclerAdapter is </p>
  
  <pre><code>package com.example.niroj.jsonandsqlite;
  public  class CustomRecyclerAdapter extends     
  RecyclerView.Adapter&lt;RecyclerViewHolder&gt; {
  
  private List&lt;Data&gt; mData = Collections.emptyList();
  
  public CustomRecyclerAdapter() {
      // Pass context or other static stuff that will be needed.
  }
  
  public void updateList(List&lt;Data&gt; data) {
      mData = data;
      notifyDataSetChanged();
  }
  @Override
  public int getItemCount() {
      return mData.size();
  }
  
  @Override
  public RecyclerViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) {
      LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext());
      View itemView = inflater.inflate(R.layout.list_item, viewGroup, false);
      return new RecyclerViewHolder(itemView);
  }
  
  @Override
  public void onBindViewHolder(RecyclerViewHolder viewHolder, int position) {
      viewHolder.title.setText(mData.get(position).text);
  
  }
  
  
  public void addItem(int position, Data data) {
      mData.add(position, data);
      notifyItemInserted(position);
  }
  
  public void removeItem(int position) {
      mData.remove(position);
      notifyItemRemoved(position);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The Data class have simply the contains</p>
  
  <pre><code>public class Data {
  public String text;
  
  public Data(String text) {
      this.text = text;
  
  }
  
  public String getText() {
      return text;
  }
  
  public void setText(String text) {
      this.text = text;
  }
  </code></pre>
  
  <p>}</p>