-2

I have a spinner in my android app which contains 15 items and I want to set the default shown items in it (other items will be shown by scrolling ). how should I set it ?

Alexander
  • 1
  • 1
  • Welcome to Stack Oveflow. Please visit the help center and take [this tour](http://stackoverflow.com/tour) to see what to ask and how. – B001ᛦ Sep 14 '16 at 13:32

1 Answers1

1

Your Spinner is like

<Spinner
        android:id="@+id/spnyear"
        android:layout_width="200dp"
        android:layout_height="40dp"
        android:layout_gravity="center"
        android:gravity="center"
        android:entries="@array/visit"
        />

and your items will be in Strings.xml

 <string-array name="visit">
        <item>Select Day</item>
        <item>Today</item>
        <item>Yesterday</item>
        <item>All</item>
    </string-array>

whichever you want to set as default put that item in the first, like i put as a

<item>Select Day</item>

it remains selected in Spinner