Answer the question
In order to leave comments, you need to log in
How to correctly click on an item?
When you click on the text, the DetailActivity does not start, but when you click on the block itself, in an area where there is no text, it goes, you need to make the block itself clickable, and as if clicked through the text. How can you achieve?
Answer the question
In order to leave comments, you need to log in
As one of the options:
In the adapter:
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
holder.view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
public class ViewHolder extends RecyclerView.ViewHolder {
public final View view;
public ViewHolder(View v) {
super(v);
view = v;
}
}
Add the following to your item's root ViewGroup:android:descendantFocusability="blocksDescendants"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question