I am currently creating a autocomplete textview which uses data from the contacts. I cant seem get to fix the error on the last line
Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
nameList = new ArrayList<String>();
while (cur.moveToNext())
{
nameList.add(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
nameList.add(cur.getString(cur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)));
}
phonenumber =(AutoCompleteTextView) this.findViewById(R.id.tosend1);
the error line is this:
ArrayAdapter<String> adapter = newArrayAdapter <String>(this,R.layout.list_item2,nameList);
What seems to be the problem??
It really helps to see the logcat errors but I found a couple mistakes and I can only guess at the rest:
Voila, every name in your and number in your contacts.