0

I have a spinner like this:

Spinner spinner = new Spinner(context);
spinner.setPadding(0, 10, 10, 0);
ArrayAdapter<ItemValue> aa = new ArrayAdapter<ItemValue>(context,
android.R.layout.simple_spinner_item,elemItemSet);
aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(aa);

Now I need a add a default/initial text programmatically (without using xml) & without adding into list 'elemItemSet'.

Is it possible?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Suniel
  • 1,449
  • 8
  • 27
  • 39

1 Answers1

0

To show defualt value(Select) at spinner,you have to add "Select" text into your array list at O index. And apply condition like "When the value of spinner is 'select' then show message to user like 'Select any value'".

I hope it will help you.

Thnaks