Android programming - onitemclicklistener for multiple listviews doesn't work

前端 未结 3 1761
礼貌的吻别
礼貌的吻别 2021-01-26 00:38

In my activity i have created seven listviews and am using viewpager to swipe between them in the same activity. I then have a sqlite database populating each listview. My probl

3条回答
  •  一生所求
    2021-01-26 01:20

    I'm not quite sure why the itemClicklistener isn't being called when you press something in listview1, but I don't think that's the biggest problem.

    You're off on a terrible start with adding 7 listviews in 1 activity, and with opening and closing your database 7 times straight after each other.

    I'd suggest you start out with the app Android UI Patterns: https://play.google.com/store/apps/details?id=com.groidify.uipatterns

    There you will find a page full of viewpagers and tabs examples. I'd suggest you take the Jake Wharton one.

    You want to be doing this with Fragments.

提交回复
热议问题