Closed vixir closed 8 years ago
This functionality is already there, just call show()
Toast.makeText(v.getContext(), topic.getText(), Toast.LENGTH_SHORT).show();
If you want to observe specifically checkbox, you have to set listener
checkbox.setOnClickListener(this);
then don't forget to compare view ids in onClick handler.
I wanted to set checkbox as clicked on the relativelayout view click. The OnClickListener in TopicViewHolder is not working.
itemView,setOnClickListener(this)
`public TopicViewHolder(View itemView) { super(itemView); topic = (TextView)itemView.findViewById(R.id.topic_name); checkbox = (CheckBox) itemView.findViewById(R.id.checkbox_tag); itemView.setOnClickListener(this); }
@Override public void onClick(View v) { Toast.makeText(v.getContext(), topic.getText(), Toast.LENGTH_SHORT); }`