Friday, March 16, 2012

[android-developers] AlertDialog and cursors

I've built an AlertDialog using a cursor to populate the list items in
the dialog. All works well with creating the list.

I even get the 'which' item back in the callback for the row
selected. One problem remains...

How do I get the text back for the item that was clicked???

I don't want to requery the cursor and spin through the results
getting to the 'which' item but I don't know how else to get the
value.

Thanks


return new AlertDialog.Builder(Gallery.this)
.setTitle(Res.string.select_genus)
.setCursor(cursor,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int
which) {
/* an item was selected */
< this is where I want to learn the text
selected??? >
},
GenusQuery.PROJECTION[GenusQuery.COMMON_NAME])
.create();

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate