Hi,
Selected data from SQLite database is placed in a cursor.
I have autocomplete textview in which I want to show only certain columns from cursor (e.g. first and last name).
I've managed to do that, but when I select an item from drop down list from autocomplete textview, it's not showing first and last name as a string (in a autocomplete textbox) but this:
android.database.sqlite.SQLiteCursor@43767ab8.
How to solve this? Please help.
Thanks in advance!
Best regards,
I. F.
Selected data from SQLite database is placed in a cursor.
I have autocomplete textview in which I want to show only certain columns from cursor (e.g. first and last name).
I've managed to do that, but when I select an item from drop down list from autocomplete textview, it's not showing first and last name as a string (in a autocomplete textbox) but this:
android.database.sqlite.SQLiteCursor@43767ab8.
Code:
.....
Cursor cursor = db.query("tblUsers", null, null, null, null, null, null);
String[] from = new String[] { "name", "lastname" };
int[] to = new int[] { android.R.id.text1, android.R.id.text2};
textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_users);
adapter = new SimpleCursorAdapter(this, android.R.layout.simple_dropdown_item_1line, cursor, from, to);
textView.setAdapter(adapter);
.....
Thanks in advance!
Best regards,
I. F.