I want to get a list of whatsapp groups (group name and group link) in android.
I can get a list of contacts like this:
[/INDENT]
How can I achieve a similar list of groups through code?
I can get a list of contacts like this:
Code:
[INDENT]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));
}
How can I achieve a similar list of groups through code?
Last edited by a moderator: