4

I am looking for the right UI widget to use for this requirement:

When the user clicks a button, a modal list appears, the user clicks and item and then the focus is returned to the active Activity.

Ian Vink
  • 66,960
  • 104
  • 341
  • 555

4 Answers4

2

You should check AlertDialog and setSingleChoiceItems on this link

fedj
  • 3,452
  • 1
  • 22
  • 21
1

This sounds like a ContextMenu.

riotopsys
  • 564
  • 4
  • 7
0

You could do that with a dialog. And you can customize the dialog with custom views as per your needs.

Some help on the dialog http://www.channels.com/episodes/show/6481543/Episode-8-The-Alert-Dialog

Pentium10
  • 204,586
  • 122
  • 423
  • 502
0

Answer from another post:

CharSequence colors[] = new CharSequence[] {"red", "green", "blue", "black"};

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Pick a color");
builder.setItems(colors, new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
        // the user clicked on colors[which]
    }
});
builder.show();
Community
  • 1
  • 1
s-hunter
  • 24,172
  • 16
  • 88
  • 130