简体   繁体   中英

Android buttons in listview

So i have been researching this for quite a while, and found nothing?

I want to create a listView that dynamically adds items to it with buttons. Is that possible?

If so, how?

Thanks!

use something like make a custom adapter. fill your listview with arraylist then use.

public void onClick(view v){
yourArrylist.add(Object);
adapter.notifyDataSetChanged();
}

for that you need to create custom or dynamic listview...

see this complete example

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