Spinner in Android

In this tutorial we will learn about Spinner in Android. If you ever worked in Java AWT or Swing then you might be familiar with Combo Box. Spinner are same like those Combo Boxes. Spinner allow an user to choose from multiple choices and user can select only one option at a single time. For example you are making an app for an education institute and you have an activity in you application where a user can apply for a course. In this kind of situation you can use Spinner which would allow a your to select one course from many. In this tutorial firstly we will learn about Array Adapters then we will move to Spinners.

Spinner in Android Learn Android for free.

Array Adapter : -

An ArrayAdapter is a class in Android which work like a bridge between UI components and source of data. The data can be in any form like in form of list, in form of cursor or in form of Array. Array adapter mainly work with the simple text data. In this tutorial we will use Array as our data source. To understand more about ArrayAdapter we will follow an illustration.

Array Adapter in Android

In this illustration you can see Adapter is working in center of our Data source and Adapter View. Adapter will take data from data source and will send it to Adapter View and after merging data and adapter view. We will set this adapter to our spinner. It might be confusing at present for many students but after seeing examples you will find it easy. So to start with spinner firstly we will add spinner in our main XML layout file.

Share this tutorial with your friends on your social Media..

Spinner in Android Spinner in Android Spinner in Android Spinner in Android

Now You Can Follow All These Tutorials on Your Android Mobile Just Download This App.