Add an interface in your adapter.
public interface SelectedUser{
void selectedUser(UserModel userModel);
}
implement the interface in your mainactivity and override the method. @Override public void selectedUser(UserModel userModel) {
startActivity(new Intent(MainActivity.this, SelectedUserActivity.class).putExtra("data",userModel));
}
Full tutorial and source code: Recyclerview with searchview and onclicklistener