title: Unable to startActivity from Recycler View Adapter
body: <pre><code>public class VendorAdapter extends RecyclerView.Adapter&lt;VendorAdapter.MyViewHolder&gt; {
  
  private List&lt;Vendor&gt; vendorList;
  
  
  public class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
      public TextView name, rating, address;
      RelativeLayout rl;
      Context con;
  
      public MyViewHolder(View view) {
          super(view);
          name = (TextView) view.findViewById(R.id.tv1);
          address = (TextView) view.findViewById(R.id.tv2);
          rating = (TextView) view.findViewById(R.id.txtstar);
          rl=(RelativeLayout)view.findViewById(R.id.parentLayout);
          itemView.setClickable(true);
          itemView.setOnClickListener(this);
      }
  
      @Override
      public void onClick(View v) {
          Intent intent = new Intent (v.getContext(), StartActivity.class);
           con.startActivity(intent);
  
      }
  }
  
  
  public VendorAdapter(List&lt;Vendor&gt; vendorList,Context con) {
      this.vendorList = vendorList;
  
  }
  
  @Override
  public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View itemView = LayoutInflater.from(parent.getContext())
              .inflate(R.layout.list_layout, parent, false);
  
      return new MyViewHolder(itemView);
  }
  
  @Override
  public void onBindViewHolder(MyViewHolder holder, int position) {
      Vendor movie = vendorList.get(position);
      /*holder.name.setText(movie.getTitle());
      holder.address.setText(movie.getGenre());
      holder.rating.setText(movie.getYear());*/
  }
  
  @Override
  public int getItemCount() {
      return vendorList.size();
  }
  </code></pre>
  
  <p>}</p>
  
  <h2>Unable to startActivity from Recycler View Adapter</h2>
  
  <p>I want to open same activity on every item click of recycler view,but the way i am doing it,i am getting NULL POINTER on this line-con.startActivity(intent);
  Please help me with this. ##</p>