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.
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.
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
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();