Ad

How To Set Unique Id For Views (like Button) On Listview That Made By Simple Cursor Adapter In Android Java?

I create a dynamic custom listview that contain some elements like button ImageView and etc using custom adapter cursor adapter. this is problem when i click on any button because of duplicate id i lost my specific button. i have set tag for each button and is correct but i can't find my button id. Also i use "button.setID()" but is not worked in some elemnts. How can I set unique id for views (like button) in this case? (In the general view I want work with any element in my listview separately )

Ad

Answer

You don't need different button(any view) ids... Just access the item with Position and find the view with ID.

Kindly read and understand the docs before apply..

Ad
source: stackoverflow.com
Ad