Android get phone number from contact list
Clash Royale CLAN TAG #URR8PPP Android get phone number from contact list I have these codes which basically use a ListView to display the names in the contact list and I want to get their phone number when click each single name: final ContentResolver cr = getContentResolver(); final Cursor c = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); myCursorAdapter = new SimpleCursorAdapter(this, R.layout.list_item, c, new String {ContactsContract.Contacts.DISPLAY_NAME}, new int{R.id.TVRow}, 0); myPhoneList.setAdapter(myCursorAdapter); myPhoneList.setOnItemClickListener(new AdapterView.OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id){ c.moveToPosition(position); Toast.makeText(getApplicationContext(), c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)), Toast.LENGTH_SHORT).show(); } }); In the onItemClick Method the onItemClick GetColumnInde...