Habib :
I want to make buildAlertMessageVersion() execute only when the value of child "version" is higher than 1.5
Here is the example I used but it only works if it's equals to 1.5
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if(dataSnapshot.exists()) {
Map<String, Object> map = (Map<String, Object>) dataSnapshot.getValue();
if(map.get("version").equals(1.5)){
buildAlertMessageVersion();
}
}
}
Rias :
Change
if(map.get("version").equals(1.5))
to if(map.get("version") > 1.5)