Skip to content

Commit

Permalink
get whats app contact
Browse files Browse the repository at this point in the history
  • Loading branch information
everbrightw committed Jul 22, 2017
1 parent 539b1d2 commit a6ae8b8
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@ private void getWhatsAppContactList(){

if(people != null && people.moveToFirst()){
people.moveToFirst();

while(!people.isAfterLast()){
HashMap<String,List> phones = new HashMap<>();
List mobileList = new ArrayList();
String name = people.getString(indexName);
String number2 = people.getString(indexNumber);
mobileList.add(0,number2);
String uid=people.getString(indexUid);
phones.put(Contact.MOBILE_PHONE, mobileList);
Contact contact = new Contact(null, name, phones, new HashMap<String,List>(), null,uid);
this.output(contact);
people.moveToNext();
}
}
HashMap<String,List> phones = new HashMap<>();
List mobileList = new ArrayList();
String name = people.getString(indexName);
String phone_number = people.getString(indexNumber);
mobileList.add(0,phone_number);
String uid=people.getString(indexUid);
phones.put(Contact.MOBILE_PHONE, mobileList);
Contact contact = new Contact(null, name, phones, new HashMap<String,List>(), null,uid);
this.output(contact);
people.moveToNext();
}
}
if (people != null) {
people.close();
}
Expand Down

0 comments on commit a6ae8b8

Please sign in to comment.