List View in Android

App Engineer

Step 1. create a xml file name as “friend_detail.xml” in layout .

Step 2. Add a list View .

Step 3 . Create a class file in src name as .

Step4 . Write following Code in OnCreate method.

final ListView listview = (ListView) findViewById(;

String[] values = new String[] { “Android”, “iPhone”, “WindowsMobile”,

“Blackberry”, “WebOS”, “Ubuntu”, “Windows7”, “Max OS X”,

“Linux”, “OS/2”, “Ubuntu”, “Windows7”, “Max OS X”, “Linux”,

“OS/2”, “Ubuntu”, “Windows7”, “Max OS X”, “Linux”, “OS/2”,

“Android”, “iPhone”, “WindowsMobile” };

final ArrayList<String> list = new ArrayList<String>();

for (int i = 0; i < values.length; ++i) {



final StableArrayAdapter adapter = new StableArrayAdapter(this,

android.R.layout.simple_list_item_1, list);


Step 5. Create a function after onCreate function .


View original post 78 more words


Leave a Reply

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

You are commenting using your 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