How to open different activity for each CardView in android?
<p>I am trying to open different Activity for different cards in CardView but I am only able to open the same activity for all the cards.
I am attaching my RVAdapter code below. Please help.</p>

<pre><code>public class RVAdapter extends RecyclerView.Adapter&lt;RVAdapter.PersonViewHolder&gt;{
List&lt;person&gt; persons;
public static class PersonViewHolder extends RecyclerView.ViewHolder{
    CardView cv;
    TextView tv1,tv2;
    PersonViewHolder(View itemView){
        super(itemView);
        cv=(CardView)itemView.findViewById(R.id.cv);
        tv1=(TextView)itemView.findViewById(R.id.tx1);
        tv2=(TextView)itemView.findViewById(R.id.tx2);
        cv.setOnClickListener(new View.OnClickListener() {
            @Override public void onClick(View v){
                cv.getContext().startActivity(new Intent(cv.getContext(), second.class));
            }

        });

    }
}
RVAdapter(List&lt;person&gt; persons){
    this.persons=persons;
}
@Override
public int getItemCount()
{
    return persons.size();
}
@Override
public PersonViewHolder onCreateViewHolder(ViewGroup viewGroup,int i){
    View v= LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.activity_scroll_activity,viewGroup,false);
    PersonViewHolder pvh=new PersonViewHolder(v);
    return pvh;
}
@Override
public void onBindViewHolder(PersonViewHolder holder, int i) {
    holder.tv1.setText(persons.get(i).name);
    holder.tv2.setText(persons.get(i).branch);

}
@Override
public void onAttachedToRecyclerView(RecyclerView rcv)

{
    super.onAttachedToRecyclerView(rcv);
}
</code></pre>

<p>}</p>