@Override public BindingHolder<PersonItemBinding> onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); PersonItemBinding binding = PersonItemBinding.inflate(inflater); binding.getRoot().setTag(binding); binding.getRoot().setOnClickListener(this); return new BindingHolder<>(binding); }
@Override public void onClick(View v) { PersonItemBinding binding = (PersonItemBinding) v.getTag(); if (binding != null) { Intent intent = new Intent(PeopleActivity.this, PersonEditActivity.class); intent.putExtra(PersonEditActivity.EXTRA_PERSON_ID, binding.getPerson().getId()); startActivity(intent); } }