There is a ListView , whose complex Item 's contain three TextView and one ImageView .

Question: how to make it so that you can click on a separate composite TextView (and not on the whole Item )?

I would be grateful for any information on this topic.

  • closer to the answer I did not ... - elik
  • one
    What is one of your ListView items? What does this element contain? - s8am
  • a journey of a thousand miles begins with one - elik
  • this is a TexvView element by clicking on which a dialog box opens - elik
  • one
    What about RecyclerView? - Eugene Suetin

1 answer 1

If I understand your task correctly:

 @Override public View getView(final int position, View convertView, ViewGroup parent) { View rootView = convertView; rootView = mLayoutInflater.inflate(R.layout.activity_main_item_list, parent, false); tvFirst = (TextView) rootView.findViewById(R.id.tvFirst); tvSecond = (TextView) rootView.findViewById(R.id.tvSecond); tvSecond.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //do something } }); return rootView; } 

So, only when you click on a specific view will you do something

  • one
    Thanks the most accurate answer to what I need) - elik