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
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
Use setView()
on AlertDialog.Builder
, passing in an ExpandableListView
that you inflate or create in Java code and have set your adapter on.
you can even make android:theme="Theme.Dialog"
in the Manifest file on that particular Activity.