Skip to main content

Posts

Showing posts with the label spinners

Using spinners in android

Spinner in android is a view which shows you a drop down menu and lets you select one of the items. Let us see how to use a spinner in your android program. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" app:layout_behavior= "@string/appbar_scrolling_view_behavior" tools:context= "com.hegdeapps.myapplication.MainActivity" tools:showIn= "@layout/activity_main" > <TextView android:id= "@+id/textView" android:layout_width= "wrap_content" android:layout_height= "wrap_content" an...