The progam needs to make decisions based on responses to several
dialogs. I wanted to use flat stucture of step and repeat queries and
then do something based on the set of answers. Using the API demos
this was the code I wanted to build with but I could not get "which1"
out of the void onClick method. Here is the code:
Button selectButton = (Button)
findViewById(R.id.select_button);
selectButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
new AlertDialog.Builder(cCommunity.this)
.setIcon(R.drawable.star_big_on)
.setTitle(R.string.select_dialog)
.setItems(R.array.select_dialog_items, new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface
dialog, int which1) {
String[] items =
getResources().getStringArray(R.array.select_dialog_items);
new
AlertDialog.Builder(cCommunity.this)
.setMessage("You selected: " +
which1 + " , " + items[which1])
.show();
}
})
.show();
}
});
As a beginner who is just learning vocabulary, how do I expose
"which1" so it can be used after the last dialogselect is made?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---