Comparing between strings goes wrong
<p>I have a class that generates the phone location and it updates a TextView every time a new location has retrieved.
We will name this class as Track.</p>

<p>The Track class contains a sendLocation object which is a Thread.
The sendLocation contatins a Track object and it checks every x time if the TextView has changed(the Track class got a method that returns the TextView string), how?</p>

<p>It save the last address in a string and compares between the last address and the Text View address every x time, if they are diffrent it sends this string to my db.
I do that to avoid duplicates.</p>

<p>My question is, how come it keeps sending same addresses to my db?I mean comparing strings is pretty simple.
Here is some code:</p>

<pre><code>if(!t1.getAddress().equals(lastAddress))
{
    lastAddress = t1.getAddress();
    //send last address to the db
    //sleep for a while
}
</code></pre>

<p>t1 is a Track instance.</p>

<p>And here is the getAddress method in Track:</p>

<pre><code>public String getAddress()
{
    return this.mAddress.getText().toString();
}
</code></pre>

<p>What's is wrong?it's a simple string comparing!!</p>
