edi233
edi233

Reputation: 3031

Add element in Spinner in android

I have a question about add item to spinner. In my class I have:

ArrayAdapter<SchType> dataAdapter = new ArrayAdapter<SchType>(this,
        android.R.layout.simple_spinner_item, schTypesList);

dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

typeSpinner.setAdapter(dataAdapter);

Now, I want to add one more item to spinner. This item should always be on bottom of list and this is not object schType. So I want to build spinner where I have list of objects from schTypesList and bottom of this list is other view which is not object from schTypesList. How can I do that?

Upvotes: 0

Views: 52

Answers (1)

darnmason
darnmason

Reputation: 2732

Create an array of String objects as that's what will be shown in the Spinner, then you are not restricted by object types.

Upvotes: 1

Related Questions