Exemple #1
0
 @Override
 public void onDataChange(DataSnapshot dataSnapshot) {
   if (dataSnapshot.getValue() != null) {
     UserWrapper userWrapper = new UserWrapper();
     userWrapper.setId(dataSnapshot.getKey());
     userWrapper.setData(dataSnapshot.getValue(UserData.class));
     mValueListener.onFinish();
     mValueListener.onSuccess(new UserWrapper[] {userWrapper});
   } else {
     Log.i(TAG, "user not found " + dataSnapshot.getKey());
     onCancelled(new FirebaseError(96, "user not found : " + dataSnapshot.getKey()));
   }
 }
Exemple #2
0
 @Override
 public void onCancelled(FirebaseError firebaseError) {
   mValueListener.onFinish();
   mValueListener.onError(firebaseError.toException(), firebaseError.getMessage());
 }