android.database.sqlite.SQLiteCursor@40199e08
How can I change the onListItemClick so that it will work right with a SimpleCursorAdapter?
- Code: Select all
Cursor c = dbhelper.fetchAllUsers();
startManagingCursor(c);
String[] from = new String[] { UserDB.KEY_username };
int[] to = new int[] { R.id.text1};
SimpleCursorAdapter userfind =
new SimpleCursorAdapter(this, R.layout.userlist, c, from, to);
setListAdapter(userfind);
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id){
super.onListItemClick(l, v, position, id);
Object o = this.getListAdapter().getItem(position);
String uname = o.toString();
username.setText(uname);
}
Thanks.






I want to know, what is the difference between, "android.R.layout.simple_list_item_1", and "android.R.layout.simple_list_item_2" that we use in "setListAdapter"...? We usually use the first one, but I don't know, when can we use the second one?