Mit der READ_CONTACTS
Berechtigung in Ihrem Manifest, können Sie synchronisierte Kontakte erhalten, die den Kontotyp gegeben. Für WhatsApp ist es "com.whatsapp"
. Also:
Cursor c = getContentResolver().query(
RawContacts.CONTENT_URI,
new String[] { RawContacts.CONTACT_ID, RawContacts.DISPLAY_NAME_PRIMARY },
RawContacts.ACCOUNT_TYPE + "= ?",
new String[] { "com.whatsapp" },
null);
ArrayList<String> myWhatsappContacts = new ArrayList<String>();
int contactNameColumn = c.getColumnIndex(RawContacts.DISPLAY_NAME_PRIMARY);
while (c.moveToNext())
{
// You can also read RawContacts.CONTACT_ID to read the
// ContactsContract.Contacts table or any of the other related ones.
myWhatsappContacts.add(c.getString(contactNameColumn));
}
starten hier: http://developer.android.com/samples/BasicContactables/index.html – ditkin
hallo, wie ex Handy-Nummer wie 1234567890 und seine verwendet zu finden in was app so wie seine verwendet finden in WhatsApp in meiner Anwendung Kontaktliste? –
Was haben Sie versucht? Gibt es Probleme mit dem Code, mit dem Sie arbeiten möchten? – ditkin