0

I want to show an ExpandableList in a Dialog. Is it possible to do so ? If yes then how ? Please help me out.

Utkarsh Mankad
  • 247
  • 1
  • 6
  • 18

4 Answers4

3

yes this is possible Create custom dialog and add expandable list in it's layout

and good tutorial for custom dialog is here

anddevmanu
  • 1,459
  • 14
  • 19
1

Should work try this:

Dialog d = new Dialog(this);
TextView test = new TextView(this);
test.setText("test");
d.setContentView(test);
d.show();

Should work with more complex views defined by you:

LayoutInflater l = this.getLayoutInflater();
View v = l.inflate(R.id.yourView, false);
d.setContentView(v);
d.show();
john
  • 57
  • 10
0

Is it possible to create an expandable list AlertDialog?

this link is also helpful for your problem it displays expendable list view in the dialog but to reduce the complexity you can create a activity with the expendable list view and show that activity as the dialog it would make it much more simpler

Android Activity as a dialog

this is helpful in displating your activity as dialog.

Community
  • 1
  • 1
Aashish Bhatnagar
  • 2,595
  • 2
  • 22
  • 37
  • Hi, I had seen the link which you've referred. But i guess, showing the activity as dialog would be a simpler option. Also, I am moving to other activity when an item is clicked. Thanks a lot for your help. – Utkarsh Mankad Jun 14 '13 at 05:55
-1

There are many ways to implement this. One easiest way that I always prefer for customized dialogs is,

Build up your UI and corresponding java coding as a usual Activity. Then in manifest, specify its theme as a dialog.

<activity android:theme="@android:style/Theme.Dialog" 
android:name="ClassName"></activity>
Nizam
  • 5,698
  • 9
  • 45
  • 57