How to get the item id in an onItemClick handler

前端 未结 4 465
花落未央
花落未央 2020-12-16 06:24

I have a category table with two columns category_id and name. I have created a data helper class named CategoryDataHelper. I have a m

4条回答
  •  醉酒成梦
    2020-12-16 07:13

    With the SimpleCursorAdapter, the onItemClick function passes in the databases id for the selected item. So, the solution is simply

    long category_id = id
    

提交回复
热议问题