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. MIDI Support in Android 1.5 SDK


I'm trying to write a music-orientated Android app that makes use of
multiple notes played concurrently but I'm finding it frustrating
trying to make sense of the audio situation in the SDK.

My intent is to play tracks of user-sequenced notes, allowing for
multiple notes (within reasonable limits) to be played concurrently,
i.e. in what a normal person would call 'chords'.

MIDI is the obvious choice but I'm at a loss as to the optimal path to

I attempted to use JetPlayer (
) and got as far as creating a JET file with one segment and 12 Events
(of type 'TriggerClip', each representing a note in a MIDI track I
created consisting of A to G# in sequence) but gave up after I could
play the entire JET file using, while
JetPlayer.triggerClip would always fail (EAS code -36, whatever that

Does anyone here have experience using JetPlayer? Is my JET file not
set up properly for my purposes or is JetPlayer innappropriate for

I don't mind creating the MIDI data programatically if need be (in
fact that might be quite nice), but so far I am lost as to what route
I should take, or if this is even currently feasible in the SDK code +



2. How to get program to not relaunch when opened from programs list??

After doing some further testing, it turns out this wasn't the
problem. It seems the problem was happening because the instance of
the app launched on the emulator when hitting run is different from
the one run when selecting the program on the phone. So it was opening
two separate instances instead of simply reopening the existing one.


3. InstrumentationTestCase and startActivityForResult

4. /dev/mem open from opencore

5. Trigger something on USB connect/disconnect

6. Adb and Gadget support at same time

7. GestureDetector in Textarea