-1

I am trying to hide a button if a logged in user is a Donor. I have my code like this.

String typ = user.get("type").toString();
    Log.d("before checking type", typ);

    if (typ == "Donor"){

        ne.setVisibility(View.GONE);
        //ne.setEnabled(false);
    }

In the log, I get the result Donor, so I know the call to the database is working. But the button I need to hide, doesn't hide. Anyone knows why?

Yohan Blake
  • 1,168
  • 3
  • 17
  • 41

1 Answers1

1

Change to:

if (typ.equals("Donor"))
Piotr Golinski
  • 960
  • 8
  • 19