lundi 26 décembre 2016

Android If statement not being accessed for some reason

please I need your help i am building this application on Android, I ran into this problem where one String data is being retrieved from Firebase database and assigned to a String value, when I try to use (IF) statement to use inside condition, all I get is compiler checking the value condition and never enter the statement. I check the running application using Debugging mode, the value stored into the string is correct and if Statement has no problem in it.

I added part of the code where I have the problem

myRef.addValueEventListener(new ValueEventListener() {
        public static final String TAG = "Testtttttttt";

        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            // This method is called once with the initial value and again
            // whenever data at this location is updated.
            String value = dataSnapshot.getValue(String.class);
            Log.d(TAG, "Value is: " + value);
            if (value == "START") {
                textView.setText(value);


            }
        }

Aucun commentaire:

Enregistrer un commentaire