title: how to send an object from a ViewHolder class to another Activity
body: <p>So I want to send an object (Person) to the Main Activity from another one which is using a recyclerView with a ViewHolder, then close the activity using the viewHolder and print the text on a textView of the Main Activity, I didn't know how to send an object from a viewHolder to another activity so I tried using an interface but I'm getting this error and I don't know how to fix it or what's the cause:</p>
  
  <p><em>java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference</em></p>
  
  <p>Which points to this line: obj.SendData_FromViewholder(selectedPerson);               </p>
  
  <p><strong>The viewHolder class</strong></p>
  
  <pre><code>class PersonaViewHolder extends RecyclerView.ViewHolder{
  
      public Person selectedPerson;
      public ArrayList&lt;SendData_FromViewholder&gt; array = new ArrayList();
  
      public PersonaViewHolder(@NonNull View itemView) {
          super(itemView);
  
          ActivityMain actMain = new ActivityMain();
          this.addInterfaz(actMain);
  
          itemView.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  selectedPerson = (Person) v.getTag();               
  
                  for(SendData_FromViewholder obj : array){       
                      obj.SendData_FromViewholder(selectedPerson);
                  }
  
                  ((Activity_PersonList)v.getContext()).finish();     // activity of the recyclerView
              }
          });
      }
  
      public void addInterfaz(SendData_FromViewholder interface){
          array.add(interface);
      }
  }
  </code></pre>
  
  <p><strong>Main activity with the interface implementation</strong></p>
  
  <pre><code>public class ActivityMain extends AppCompatActivity implements SendData_FromViewholder {
      @Override
      public void getPersonFromViewholder(Person person) {
          TextView textView = findViewById(R.id.tv_mainHeader);
          textView.setText(person.getName()+" - ID:"+person.get_id());
      }
  }
  </code></pre>
  
  <p><strong>The interface class</strong></p>
  
  <pre><code>public interface SendData_FromViewholder {
      void getPersonFromViewholder(Person person);
  }
  
  </code></pre>