简体   繁体   中英

Populate custom listview when I click on another custom listview item

I have two listviews with custom adapters. The first listview contains names of lists. When I click on the name of a list, the second listview have to be populated with the contents of the clicked list. I need to read the contents of the list from a local SQLite database that's located in assets, but that's not important. Assume that I have array of the contents. I know how to do this if I have to populate them on button click, but I don't know to do it this way. Both listviews are in the same activity.

by using onItemClickListener of listview u can do this.

on onitemclickListener of first listview u set adapter for the second listview

u can do this using one customadapetr and u can write separate customadapter for both

listview .

if u post some sample code i will try to give more specific answer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM