如何从firebase数据库中检索用户配置文件信息并将其显示在导航抽屉标题中?
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Map<String, String> map = dataSnapshot.getValue(Map.class);
String firstname = map.get("firstname");
String lastname = map.get("lastname");
String phone = map.get("phone");
Log.v("E_VALUE", "firstname : " + firstname);
Log.v("E_VALUE", "lastname : " + lastname);
Log.v("E_VALUE", "phone : " + phone);
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}