Skip to content

Instantly share code, notes, and snippets.

@rmasters
Created June 13, 2012 01:33
Show Gist options
  • Save rmasters/2921229 to your computer and use it in GitHub Desktop.
Save rmasters/2921229 to your computer and use it in GitHub Desktop.

The code:

String targetStr = in.readString();
if (targetStr != "null") {
    Log.d("ASDF", "\"" + targetStr + "\"");
    target = fmt.parseDateTime(targetStr);
}

Log:

06-13 02:31:22.429: D/ASDF(25738): "null"

HOW IS THIS POSSIBLE!?

Edit: Oh, == actually compares objects rather than the actual string values...

@phalt
Copy link

phalt commented Jun 13, 2012

Yeah you have to do the whole String.equals("null"); and stuff.

It is really weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment