How To Get Widget Ids Of Selected Row Of Listview
Solution 1:
As you want to get hold of the textview in the same row, you can do the following.
with the textview that was clicked get its parent and then using the parentview you can search for your textview:
Viewparent= (View) textViewThatWasClicked.getParent();
if (parent != null) {
TextViewtextViewThatYouWantToChange= parent.findViewById(R.id.textViewThatYouWantToChange);
textViewThatYouWantToChange.setText(...);
}
you will need to change the id that you look for to the id you have for that other textview. If you need to set an id you can do this in the xml layout file you used.
I cant follow your code well enough to actually give you the code but this should be enough to get you in the right direction.
Solution 2:
If you have custom layout for each row in listview then you can provide id for each of the View in your custom view and then set setOnItemClickListener for your listview and you'll be able to reach each row as a view. When you have access to your row like a View then you can use view.findViewById and get all of your views from your custom view by their id.
Post a Comment for "How To Get Widget Ids Of Selected Row Of Listview"