Java if statement not working on a condition of a service : <p>I have created an app in android studio and it uses a background service which has a method which starts a counter of seconds. I have created an if statement to test if the seconds are at 0 and when i debug the value seems to be correct  but the condition is jumping straight to the else statement and i can not figure out why. </p>

<pre><code>  public void checkService(){
              long secs = seconds;

        String str = String.valueOf(secs);

        if(str == "0")
        {
            Toast.makeText(this, "Not started", Toast.LENGTH_SHORT).show();
        }
        else
        {
            Toast.makeText(this, "Running", Toast.LENGTH_SHORT).show();
        }
    }
</code></pre>

<p>It is jumping to the second esle even when the value is 0. The image shows the value of str when i was debugging.  </p>

<p><a href="https://i.stack.imgur.com/wSCIq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wSCIq.jpg" alt="enter image description here"></a></p>
