Loading...

Android Drop Down List Example

In this tutorial, you will learn to implement drop down list in android application and control when the user selects one of the item from a set. To make drop down, I have used Spinner. You can add drop down items either from java code or xml string array.

Related:
Android Time Picker Example
Android Layouts Tutorial
Android Material Design with Design Support Library

Android Tutorial: Android Drop Down List Example


XML Layout File

Following is the xml layout file which contains two .
res/layout/activity_main.xml

Java Activity File

Following is the java activity file which control drop down list item is selected.
src/MainActivity.java

Strings.xml File

res/values/strings.xml

Now, run your application which will look like output given below.

Output:


Android Drop Down List Example
DropDown List

UI 3864506219285821820
Home item