0

This is my code.When user clicks button i execute this code

finalteamcount.addValueEventListener(new ValueEventListener() {
                @Override
                public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                    String one = "one";
                    String two = "two";
                    String three = "three";
                    String four = "four";
                    String qwq = dataSnapshot.getValue(String.class);
                    if (qwq == null){finalteamcount.setValue(one);}
                    if (qwq == one){finalteamcount.setValue(two);}
                    if (qwq == two){finalteamcount.setValue(three);}
                    if (qwq == three){finalteamcount.setValue(four);}

                }

It Directely set four, the value i am retriving is null

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441

0 Answers0