Thank you for your hint. I was able to get it to work with one little
problem left. I now read all my database values into an array and use
ArrayAdapter<> to fill the AlertDialog. The problem is, the list shows
the list entries with white text on a white background (only while
clicking an entry which makes the background orange reveals the text
of the entry).
What is my error here?
ArrayAdapter<MyObject> adapter = new
ArrayAdapter<MyObject>(this,
android.R.layout.simple_list_item_single_choice,
mMyObjectsArray);
AlertDialog.Builder ad = new AlertDialog.Builder(this);
ad.setSingleChoiceItems( adapter, 0, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
load(which);
}
});
ad.show();
Thanks
On 22 Jun., 20:17, Mark Murphy <[email protected]> wrote:
> On Tue, Jun 22, 2010 at 2:16 PM, maik <[email protected]> wrote:
> > I have a spinner selection box on my activity, but now I want to
> > remove the spinner from the main view and make the selection available
> > by an option from the menu button. How do I get the dialog the spinner
> > shows if I click it without having the spinner?
>
> Use an AlertDialog.
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en