I tried with passing context of activity into the adapter and then i tried context.finish(); But its giving me one error like The method fini
Code for this is ((Activity)context).finish();and complete code is
holder.cardUsers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent1=new Intent(mcontext,AstroChatPanel.class);
intent1.putExtra("mobile",userslist.get(position).getMobile());
intent1.putExtra("name",userslist.get(position).getName());
intent1.putExtra("type","admin");
mcontext.startActivity(intent1);
((Activity)mcontext).finish();
}
});