I have a code from where I can get the contacts name in a auto complete text view, here is my code
autoContacts=(AutoCompleteTextView)findViewById(R.id.actvContacts);
Cursor emailCursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
startManagingCursor(emailCursor);
autoContacts.setAdapter(new SimpleCursorAdapter(this, android.R.layout.simple_dropdown_item_1line, emailCursor, new String[] {Email.DATA1}, new int[] {android.R.id.text1}));
autoContacts.setThreshold(0);
but when I click in one of the name then it sets a text in that Autocomplete textview like this:
android.content.ContentResolver$CursorWrapperInner@44efc9c8
but here I want to set the specific phone number on that, how to fix this issue?
You need to use the setCursorToStringConverter
In your case you could do something like this: