title: RecyclerView With Fragment is not Working! Showing Error
body: <p><code>RecyclerView</code>  with <code>Fragment</code> is not working, its showing error and application get crash at runtime .</p>
  
  <pre><code>public class FragmentList extends Fragment {
    String [] names={"Nitin","Manish","Ankit","Hardik","Mayur","Mayank"};
  
    RecyclerView mRecyclerView;
    Context context;
    RecyclerAdapter mAdapter;
  
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      View v=inflater.inflate(R.layout.fragment_list,container,false);
  
      setupRecyclerView();
      return v;
    }
  
    private void setupRecyclerView() {
      mRecyclerView= (RecyclerView)getView().findViewById(R.id.recycler_nit);
      LinearLayoutManager mLayout= new LinearLayoutManager(context);
      mLayout.setOrientation(LinearLayoutManager.VERTICAL);
  
      mAdapter= new RecyclerAdapter(context,names);
      mRecyclerView.setAdapter(mAdapter);
    }
  </code></pre>
  
  <p>Its showing error at run time and app get crash before starting,</p>
  
  <p>and here is adapter class for that <code>RecyclerView</code>:</p>
  
  <pre><code>Context context;
  String[] names;
  
  public RecyclerAdapter(Context context, String[] names) {
    this.context = context;
    this.names = names;
  }
  
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
    RecyclerView.ViewHolder vh;
    View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.raw_list,parent,false);
  
    vh=new ViewHolder(v);
  
    return (ViewHolder) vh;
  }
  
  @Override
  public void onBindViewHolder(ViewHolder holder, int position) {
    holder.txt.setText(names[position]);
  }
  
  @Override
  public int getItemCount() {
    return 0;
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
    TextView txt;
    public ViewHolder(View itemView) {
      super(itemView);
  
      txt= (TextView) itemView.findViewById(R.id.name_listtext);
  
    }
  }
  </code></pre>
  
  <p>its showing:</p>
  
  <blockquote>
    <p>FATAL EXCEPTION: main
                                                                              Process: com.example.hp.newfragment, PID: 3354</p>
    
    <p>java.lang.RuntimeException: Unable to start activity
    ComponentInfo{com.example.hp.newfragment/com.example.hp.newfragment.MainActivity}:
    android.view.InflateException: Binary XML file line #17: Error
    inflating class fragment</p>
  </blockquote>
  
  <p>Thanks for help in advance ......</p>