I have this structure in Firebase
And I'm calling the last three data with the name "dose" with this structure
my.child("usuario").orderByKey().limitToLast(3).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for(DataSnapshot snapshot : dataSnapshot.getChildren()) {
usuario us =snapshot.getValue(usuario.class);
Log.e("Datos: " , "" + us.getDosis());
}
}
in debug appear
E / Data :: 160 E / Data :: 12 130
but I need to identify them and compare them in an if and generate the result and show it on the screen. Someone knows how I could do them, Thanks.