ストアすべての連絡先を助けて感謝しています。キーとしての名前と値としての名前。ここで私は
HashMap<String, String> phoneContacts = new HashMap<>();
として作成し、今
void getFirebaseContacts(){
databaseReference.child("ProfileData").addListenerForSingleValueEvent(new ValueEventListener() { //all users profile data
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Map value = (Map) dataSnapshot.getValue();
if (value != null) {
Iterator myVeryOwnIterator = value.keySet().iterator();
while (myVeryOwnIterator.hasNext()) {
String Mobile = (String) myVeryOwnIterator.next();
if (Mobile != null && phoneContacts.containsKey(Mobile)) {
//Mobile and it's associated details will be stored in local database and displayed to user..
Map userData = (Map) value.get(Mobile);
}
}
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
このメソッドを呼び出しています