我目前正在创建一个使用联系人数据的自动完成文本视图。我似乎无法修复最后一行的错误
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);
错误行是这样的:
ArrayAdapter<String> adapter = newArrayAdapter <String>(this,R.layout.list_item2,nameList);
好像有什么问题??