AutoCompleteTextView with SimpleCursorAdapter for Contacts not returning cursor actual value
<p>I have a AutoCompleteTextView that uses a SimpleCursorAdapter to filter emails for an input field. I have it working, although there are some <code>deprecated</code> commands that I am not sure how to rework.</p>

<p>The only problem I am having is that when I select a value from the list provided, I am not getting the email address selected, but something like the following:</p>

<pre><code>android.content.ContentResolver$CursorWrapperInner@13a08d9c
</code></pre>

<p>Here is the code I have:</p>

<pre><code>final AutoCompleteTextView edt_Contact = (AutoCompleteTextView)findViewById(idTo);

    ContentResolver cr = getContentResolver();
    String[] projection={ContactsContract.CommonDataKinds.Email._ID,ContactsContract.CommonDataKinds.Email.ADDRESS};
    Cursor cursor = cr.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI, projection, null, null, null);

    startManagingCursor(cursor);
    String[] from = new String[] { ContactsContract.CommonDataKinds.Email.ADDRESS};
    int[] to = new int[] { android.R.id.text1};
    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, cursor, from, to);

    adapter.setFilterQueryProvider(new FilterQueryProvider() {
        public Cursor runQuery(CharSequence constraint) {
            return getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
                    new String[] {},
                    ContactsContract.CommonDataKinds.Email.ADDRESS + " LIKE '%" + constraint + "%'",
                    null, null);
        }
    });

    edt_Contact.setAdapter(adapter);
</code></pre>

<p>Any suggestions on how to get the actual selected value to populate the AutoCompleteTextView when selected?</p>

<p>Also, as mentioned, the deprecated items are <code>startManagingCursor</code> and <code>SimpleCursorAdapter</code>.</p>