CLICK HERE TO EARN MONEY FREE

Wednesday, November 28, 2012

ListView


 ListView is a ViewGroup that creates a list of scrollable
items. The list items are automatically inserted to the list
using a ListAdapter.

Introduction
 List View
Introduction
Change extends

public class ListView extends ListActivity {
Introduction
We want to display these names
as our list items
String[] names = {
"Ashley","Ben","Charles","Dean","Elly","Fiona","George","
Hitch","Iris","John","Ken",
           
"Lily","Matt","Nick","James","Penny","Queen","Richard","S
am","Tom","Vincent",
           "Wilson","Noah"
    }; you need change according to u r wish .country name.
Introduction
Create an ArrayAdapter that will contain all list items

ArrayAdapter<String> adapter;

Assign the name array to that adapter and also
choose a simple layout for the list items

adapter = new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,n
ames);

Assign the adapter to this ListActivity

setListAdapter(adapter)

0 comments:

Post a Comment

 

TEKONOLOGY Copyright © 2011 -- Template created by TEKONOLOGY -- Powered by Blogger