AlertDialog - selected item

by Ajay » Thu, 22 Apr 2010 18:58:31 GMT

Sponsored Links
   I have an AlertDialog with a list of selectable items and a OK
button. How can I get the selected option, when the user clicks the OK

Thank you,


AlertDialog - selected item

by Mark Murphy » Thu, 22 Apr 2010 19:02:56 GMT


Try calling getListView() on the AlertDialog. From there, you should be
able to call getCheckedItemPosition().

Mark Murphy (a Commons Guy)  | 

Android Consulting: 


Sponsored Links

AlertDialog - selected item

by Ajay » Thu, 22 Apr 2010 19:16:33 GMT

 Thanks a lot again for a very quick reply!! You are a life saver :-)


Other Threads

1. Sensor and Compass APIDemo failing on emulator 1.5

I have been trying to use the OS->sensor and graphics->compass in the
APIDEMO (through emulator 1.5) by directly browsing through the menu
or through instrumentation, I have observed that for ensor and
compasstest the output is blank screen, but on virtual box the
output is proper. Also note that proper output is seen in case of 1.1

Is this a bug in emulator 1.5 ?


2. Intent filters: how do I know which action to use?

Hi all,

Here's my situation: I'd like to implement support for an alternative
"share" feature for images taken with the camera.  When I take a
picture on my device and then pull up the menu for that picture, I get
a "Share" option; then, I get a list of options (Picasa, Gmail, etc).
I'd like to add my own sharing service to that list. My understanding
of the framework thus far indicates I should probably create an
activity with an intent filter saying "I'm an alternative for the user-
shares-an-image action."

Now, I don't know if it's even possible to do that; but what I've
found puzzling is that there doesn't seem to be a way to figure out,
given some behavior in some application, how to find out which action
is constituted by the behavior I want to augment.  In this case, I
think I want to provide an alternative sharing activity, but I haven't
been able to find any documentation on what such an activity's intent
filter should look like.

If anyone has pointers for my specific situation, that would be great,
but my bigger concern is how to solve this problem next time I see a
behavior I want to modify/replace/etc.

Thank you!


3. Reusable Spans

4. Animated GIF

5. Persisting app data (not preferences)

6. Hi everybody....

7. Delete non empty folders