There's a setItems that takes a CharSequence[], so convert your ArrayList to
CharSequence[].

jason

On Tue, Jan 6, 2009 at 6:30 PM, intbt <[email protected]> wrote:

>
> I need to setItems from a generated ArrayList.
>
> Eclipse gives me an error that the setItems must be a int source. I
> have made it work with a stored Array from R.array.xxxx. How do I
> change my arraylist to a format accepted by the AlertDialog.Builder
> setItems command?
>
> This code works with a pre-defined array in arrays.xml ('test'):
>
>                new AlertDialog.Builder(this)
>
>                .setTitle(R.string.new_defn)
>                .setItems(R.array.test,
>                new DialogInterface.OnClickListener() {
>                        public void onClick(DialogInterface dialoginterface,
>                        int i) {
>                                showDefn(i);
>                                }
>                        })
>
>
>                .show();
>                }
>
> But I want to replace 'R.array.test' with 'results' - a code generated
> arraylist
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to