package com.example.hellotwolistviews;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class HelloTwoListViews extends ListActivity {
private String[] mStrings = {
"Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam",
"Abondance", "Ackawi",
"Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l",
"Pitu", "Airag", "Airedale",
"Aisy Cendre"};
private String[] mStrings2 = {"dsds", "qwqwqq", " dsdsdsd sdsdsds",
"dsdsds sdsds"};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//setListAdapter for ListView 1
setListAdapter(new ArrayAdapter<String>(this, .layout.main,
.id.ScrollView01, mStrings));
//Code to display ListView 2
ListView cities = (ListView) findViewById(R.id.ListView02);
ArrayAdapter<String> aa = new ArrayAdapter<String>(this, .layout.main,
.id.ListView02, mStrings2);
cities.setAdapter(aa);
}
}
thats my sample code,please check it out.