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?
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
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?
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
Can't connect to the google api, the result on the monitor is:
I know this is a very generic questionBut I really could not find any specific code that cause my fragment lose scroll position