-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,298
  • 4
  • 21
  • 43

1 Answers1

1

Change to:

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