protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
db=new DBAdapter(this);
db.open();
Cursor c = db.getrecord();
c.moveToFirst();
String[][] records = new String[c.getCount()][2];
for(int i =0; i<c.getCount(); i++)
{
records[i][1]=c.getString(0);
records[i][2]=c.getString(1);
c.moveToNext();
}
ArrayAdapter<String> a = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_2,records);
setListAdapter(a);
}
我想问一下,我想在一个列表中显示两条记录,如
id name
1 kashif
2 rana