Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to create popup with choices

Tags:

android

I want to do something like this: user clicks on a button "Choose color", and a simple popup with e.g. 5 colors appears. I could do this with PopupWindow and inner ListView, but is there a simpler solution, like a specific widget for this?

How it should look like: alt text

like image 983
fhucho Avatar asked Feb 28 '23 17:02

fhucho


1 Answers

Use AlertDialog.Builder and supply an Adapter via setAdapter() that generates your rows.

like image 112
CommonsWare Avatar answered Mar 05 '23 15:03

CommonsWare