title: Start activity from ViewHolder onclick
body: <p>I´m tryng to start a new activity when the user clicks on a RecycleView element . The problem is that only one field of object I want to pass to JSON is show in the row_item Layout and don´t know how to retrieve the other 3 object fields.</p>
  
  <p>Here are the steps I´m following . </p>
  
  <p>First I send a list of objects (Poliza) to the adapter .
  Second I show only one field of the object (poliza) in the RecycleView .
  Third  I want to start a new activity when the user clicks on the RecycleView item , sending a JSON of the object with the other object fields that are not show in the row_item .</p>
  
  <p>Here is my adapter</p>
  
  <pre><code>public class PolizasAdapter extends RecyclerView.Adapter&lt;PolizasAdapter.PolizaViewHolder&gt; {
  
      private List&lt;Poliza&gt; listapoliza = null;
      private Context context;
  
      public PolizasAdapter(  List&lt;Poliza&gt; listapoliza) {
          this.listapoliza = listapoliza;
      }
  
      public class PolizaViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
          // each data item is just a string in this case
          TextView txtPoliza;
  
          public PolizaViewHolder(View view) {
              super(view);
              //Agregamos un onclickListener
              view.setOnClickListener(this);
              context = view.getContext();
              //Hacemos referencia a las vistas del rowitem
              txtPoliza = (TextView) view.findViewById(R.id.txt_poliza);
          }
  
          @Override
          public void onClick(View view) {
              //Evento que que se genera cuando se da click
              TextView texto = (TextView) view.findViewById(R.id.txt_poliza);
              String str = texto.getText().toString();
              System.out.println(str);
              //Iniciamos actividad mostrando el detalle
  
               Intent intent = new Intent(context , DetalleActivity.class);
               intent.putExtra("id_poliza",str);
              //Whats next ?
              //How to add the other 3 fields of my object to the putExtra
  
  
          }
      }
  
      @Override
      public PolizasAdapter.PolizaViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          //Creamos una nueva vista
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_item, parent, false);
          PolizaViewHolder viewHolder = new PolizaViewHolder(view);
          return viewHolder;
      }
  
       @Override
      public void onBindViewHolder(PolizasAdapter.PolizaViewHolder holder, int position) {
  
          holder.txtPoliza.setText("Poliza : " + String.valueOf(listapoliza.get(position).getPoliza()));
      }
  
     )
      @Override
      public int getItemCount() {
          return listapoliza.size();
      }
  }
  </code></pre>