Question

I have the current code:

ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item, array_spinner);
        adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );
        colourSpinner.setAdapter(adapter);

How would i put a vector into my array_spinner?

Thank you.

Was it helpful?

Solution

The Vector class is considered deprecated, don't use it. Use a List instead. Then you can use the overloaded ArrayAdapter constructor:

ArrayAdapter(Context context, int resource, int textViewResourceId, List<T> objects)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top