At first, I used the following method:
Public VoidOnitemclick (adapterview <?>Parent, view V,IntPosition,LongID) {view curr= Parent. getchildat ((Int) ID); textview C=(Textview) curr. findviewbyid (R. Id. tvpopupitem); string playerchanged=C. gettext (). tostring (); toast. maketext (settings.This, Playerchanged, Toast. length_short). Show ();}
However, after scrolling, you can find that the obtained value is incorrect. The correct method should be as follows:
Public VoidOnitemclick (adapterview <?> Parent, view V,IntPosition,LongID) {textview C=(Textview) v. findviewbyid (R. Id. tvpopupitem); string playerchanged=C. gettext (). tostring (); toast. maketext (settings.This, Playerchanged, Toast. length_short). Show ();}
My understanding: the view returned by onitemclick is the view of the selected row, and then the control in the current view is searched by ID, which is no doubt accurate !!!