I know there are lot many solutions for the same kind of question on the web, but still I couldn't find one to serve my needs.
I have a spinner in my layout xml and a string array in strings.xml .
<string-array name="days">
<item>Monday</item>
<item>Tuesday</item>
<item>Wednesday</item>
<item>Thursday</item>
<item>Friday</item>
<item>Saturday</item>
</string-array>
and the java code as
Spinner days=(Spinner) findViewById(R.id.days_1);
ArrayAdapter adapter=ArrayAdapter.createFromResource(this,
R.array.days,R.layout.support_simple_spinner_dropdown_item);
days.setAdapter(adapter);
I want to set up hint for spinner.
I have already read other answers for the same question but when I add an item in the string-array
<string-array name="days">
<item>Monday</item>
<item>Tuesday</item>
<item>Wednesday</item>
<item>Thursday</item>
<item>Friday</item>
<item>Saturday</item>
<item>Select the Day</item> <!--New item-->
</string-array>
and in java after this line
days.setSelection(/*last element*/);
what happens is that the hint becomes permanent in the drop-down list. It is not working as the hint in edittext.
Please suggest me some method to set the hint for that.
Thanks in advance.