Java Equality not Behaving as Expected
<p>I'm currently working on an android application that uses a subclass of SimpleListAdapter to bind a ListActivity.  The list that the Adapter binds to is of type <code>List&lt;HashMap&lt;String, Object&gt;&gt;</code>.</p>

<p>I have to following If statement in the list Adapter...</p>

<pre><code>if (dataRow.get("HasLineup1").toString()) == "0")
</code></pre>

<p>This never evaluates to <code>true</code> for me, even when the Eclipse debugger says that <code>dataRow.get("HasLineup1").toString()</code> is equal to <code>"0"</code> in the inspection window.</p>

<p>The list of data is populated from an XML source with the line </p>

<pre><code>Game.put("HasLineup1", attributes.getNamedItem("home_lineup").getNodeValue());
</code></pre>

<p>I managed to work around the issue by changing the If statement to</p>

<pre><code>if (Integer.parseInt(dataRow.get("HasLineup1").toString()) == 0)
</code></pre>

<p>Can someone explain to me why the first If statement I used wasn't working?  Java isn't my native language, but I can't for the life of me figure out what I'm doing wrong based on my .Net background.</p>
