

Spinner s1 = (Spinner) findViewById(R.id.spinner1) ĪrrayAdapter adapter = ArrayAdapter.createFromResource( Get a Spinner and bind it to an ArrayAdapter that People's names from the device contacts (see Contacts.People).

That reads an array of colors from the local resources. Creates a Spinner with an existing View and binds it to a new ArrayAdapter.The following code sample does the following: The code supplies or query results from the device's database). Inserting data into the layout is typically done by binding the AdapterView class to an Adapter, which retrieves data from an external source (perhaps a list that Gallery, ListView, and Spinner are examples of AdapterView subclasses that you can use to bind to a specific type of data and display it in a certain way.ĪdapterView objects have two main responsibilities: AdapterView is useful whenever you need to display stored data (as opposed to resource strings or drawables) in your layout.

The AdapterView is a ViewGroup subclass whose child Views are determined by an Adapter thatīinds to data of some type.
