Android tutorial : Spinner basics
The Spinner of Android is the equivalent of drop-down boxes that are found in some development kits (JComboBox in Java / Swing, for example). Press central button of the terminal pad brings out a dropdownlist allowing the user making his choice. We can choose from a list without occupying the entire screen as with a ListView, but at the cost of an extra click. As ListView, we must provide the adapter for data and child views via setAdapter () and a listener is hung with setOnItemSelectedListener (). If you want to customize the display of the combo box, you must configure the adapter, not the Spinner widget. To do this, we need a method therefore setDropDownViewResource () for providing the identifier of the relevant picture. Here is a sample xml code to implement a simple view containing a Spinner: main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" an...