I was trying to set prompt in Spinner in android,over dynamically add data in spinner.Firstly, I have used spinner.setPrompt(" Branch List ") but couldn't set it in spinner. though my this line of code is wroking. But still didn't get it done.and then I used second method which is as follows:
I here by share my code of xml which is second method that I've used for setting prompt.
MainActivity.xml
<Spinner
android:layout_width="250dp"
android:layout_height="wrap_content"
android:id="@+id/branchSpinner"
android:spinnerMode="dropdown"
android:prompt="@string/Branch"
/>
Stings.xml
<string name="Branch">Branch</string>