Android Basics – Learn how to use Adapter with ListView

In the last Post you learnt about the ListActivity class. In this Tutorial I want to introduce you to Adapters and how to use them with ListView.

Adapters are used to bind or connect View with Data Source. Now a data source can be an array, a database or a web service.

An ArrayAdapter enables us to work with Arrays. Creating one is pretty simple.

ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, colors);

You can follow along with me in the Video above to understand about Adapters.

Source code can be found here

Author: codesmartly

I am Enthusiastic about Learning new things and sharing my Knowledge. I like programming and have a pretty good background in Computer Science.

One thought on “Android Basics – Learn how to use Adapter with ListView”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s