Android - ContentResolver$CursorWrapperInner@

464
January 11, 2017, at 03:56 AM

I am trying to use the numbers from the phones contact list with AutoCompleteTextView so when the user starts typing a number it will show suggestions to auto complete from his contacts.

Everything works just fine, expect the output which is: android.content.ContentResolver$CursorWrapperInner@

relevant part of code:

public void autoComplete(){
        AutoCompleteTextView actv = (AutoCompleteTextView) findViewById(R.id.telefon);
        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_2, null,
                new String[] {ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER},
                new int[] {android.R.id.text1, android.R.id.text2, },
                0);
        FilterQueryProvider provider = new FilterQueryProvider() {
            @Override
            public Cursor runQuery(CharSequence constraint) {
                if (constraint == null) {
                    return null;
                }
                return getContentResolver().query(Uri.withAppendedPath(ContactsContract.CommonDataKinds.Phone.CONTENT_FILTER_URI, constraint.toString()), null, null, null, null);
            }
        };
        adapter.setFilterQueryProvider(provider);
        actv.setAdapter(adapter);
        }

What i'm doing wrong?

Rent Charter Buses Company
READ ALSO
Long running tasks with callbacks to activity or fragment

Long running tasks with callbacks to activity or fragment

Question: What is the best practice for reporting progress/complete from long running task to an Activity? And what to do when the progress/complete report happens while the Activity is in the background/orientation changes?

374
How to get setting value from VolumePreference

How to get setting value from VolumePreference

For the application I am working on, I need to have a preference screen, which has a EditTextPreference, SwitchPreference and a VolumePreferenceI am using the VolumePreference as I need a preference that is set with a slider, and VolumePreference was the only one I could find that fit the bill

492
result_canceled using google fit api

result_canceled using google fit api

Can't connect to the google api, the result on the monitor is:

558
why I lost scroll position for my android fragment?

why I lost scroll position for my android fragment?

I know this is a very generic questionBut I really could not find any specific code that cause my fragment lose scroll position

388