-3

How to set default value in spinner if nothing is selected in spinner.

So ,guys Please help me in getting out of these error.

Thanks in advance for your reply.

1 Answers1

-1

You can set the appropriate property of Spinner i.e android:prompt="Your Default Title". This will be the default value that will come display on the Spinner when no item is selected.

You need to set the property of this in XML file for the Spinner.

Dev-iL
  • 23,742
  • 7
  • 57
  • 99
darshit261991
  • 146
  • 3
  • 9
  • that i did darshit and i want to have deafult value to seen if nothing is selected . i did what your telling but that value i m seening in my list which i dnt want – amit gahlot Aug 30 '14 at 06:11
  • I guess i got it what you want to do.. You can simply add an default object to Array and then add property on itemSelected event of Spinner i.e. setSelection(0) for this array. And just remove the object from the array if user selects any other object.. – darshit261991 Aug 30 '14 at 09:35