15
Lesen Sie die Telefonnummern aller Kontakte in Android
Ich verwende diesen Code, um alle Kontaktnamen und Telefonnummern abzurufen: String[] projection = new String[] { People.NAME, People.NUMBER }; Cursor c = ctx.getContentResolver().query(People.CONTENT_URI, projection, null, null, People.NAME + " ASC"); c.moveToFirst(); int nameCol = c.getColumnIndex(People.NAME); int numCol = c.getColumnIndex(People.NUMBER); int nContacts = c.getCount(); do { // Do something } while(c.moveToNext()); …