简体   繁体   中英

How to create widget with ExpandableListView?

I want to create widget which will show some information divided into categories. I came with idea to use ExpandableListView in my widget. Is is possible? If yes - how to do this?

Yes, this is possible. you need to extend BaseExpandableListViewAdapter and implement the methods in it. You also need to make the layout xml files for whatever you want to show and specify this to the adapter or inflate it yourself if you have more than one.

A good example is http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ExpandableList1.html which is where the expandable list is the whole activity on the screen but if you extend it like how i said in a seperate file and include a ExpandableListView in your activity that will work as well.

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