Spinner in Android

Spinner is a dropdown list in Android. Using spinner we can select an item from multiple drop down menu. Spinner is mostly used in selection of one item from multiple items, but number of items were in medium size and not more.

For example, at the time of creating a Gmail account, we select Date of Birth using drop down menu.

In this tutorial we see, how to use spinner with static data in android. Declare array in strings.xml(res->values->strings.xml if not created then create it first).

strings.xml

activity_main.xml

MainActivity.java

Now run project. Our output looks like below,

android-spinner-example-output-skynils

Download Project.
downlod

Now see next tutorial Custom Shape Button in Android.