public class MyList extends ListActivity {
/** Called when the activity is first created. */
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
// Create an array of Strings, that will be put to our ListActivity
String[] names = new String[] { "Sun", "Mercury", "Venus", "Earth",
"Mars", "Jupiter", "Saturn", "Uranus" };
// Use your own layout and point the adapter to the UI elements which
// contains the label
this.setListAdapter(new ArrayAdapter<String>(this, R.layout.rowlayout,
R.id.label, names));
}
}