Is it possible to create an expandable list AlertDialog?

后端 未结 3 648
醉梦人生
醉梦人生 2021-02-13 09:13

In my app the users are able to select articles to download using different criteria. One of them is year and month. For this I would like an AlertDialog with a list of years. I

相关标签:
3条回答
  • 2021-02-13 09:51

    Well, to use the listviews you have to extend the appropriate list-activity, in your case ExpandableListActivity. You wont be able to find a ExpandableListDialog to extend.

    I suppose you might be able to implement it in the activity which calls the dialog, and pass on the listview to the dialog as a reference, and manually add it to your layout in the dialog. Im not sure if this will work, but its worth a shot :D

    0 讨论(0)
  • 2021-02-13 10:14

    Use setView() on AlertDialog.Builder, passing in an ExpandableListView that you inflate or create in Java code and have set your adapter on.

    0 讨论(0)
  • 2021-02-13 10:15

    you can even make android:theme="Theme.Dialog" in the Manifest file on that particular Activity.

    0 讨论(0)
提交回复
热议问题