How to use simple_list_item_2 with android listview?
how did I have to extend my example to use a two line listview (for example read out the email from database)?
ArrayList<String> db_results = new ArrayList<String>();
Cursor c = db.rawQuery("SELECT lastname, firstname FROM contacts ORDER BY lastname",null);
while(c.moveToNext()) {
db_results.add(String.valueOf(c.getString(c.开发者_Go百科getColumnIndex("lastname"))) + ", " + String.valueOf(c.getString(c.getColumnIndex("firstname"))));
}
c.close();
lv1.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,db_results));
Thanks ...
精彩评论