Error when checking if two strings are the same in android
<p>I am trying to check if two strings are the same, the first string I get from a Pastebin RAW, and the second I have saved in my assets folder in my project. The text is exactly the same, but when I try to check if they are the same with</p>

<pre><code>if(total.toString().equals(result)){
   display.setText(
      "The two files are the same \n Log.txt: " + total.toString() +
      "\n Pastebin: " + result);
} else if(total.toString()!=result) {
   display.setText(
      "The two files arent the same \n Log.txt: " + total.toString() +
      "\n Pastebin: " + result);    
</code></pre>

<p>It goes straight to my else if and displays that, I have tried deleting the file and making new Pastebins.</p>

<p>The full code I use is this</p>

<pre><code>   InputStream is = getAssets().open("Log.txt");
   BufferedReader r = new BufferedReader(new InputStreamReader(is));
   StringBuilder total = new StringBuilder();
   String line;
   while ((line = r.readLine()) != null) {
      total.append(line);
   }
   // Loads the text from the pastebin into the string result
   HttpClient httpClient = new DefaultHttpClient();
   HttpContext localContext = new BasicHttpContext();
   HttpGet httpGet = new HttpGet("Pastebin url");
   HttpResponse response = httpClient.execute(httpGet, localContext);
   String result = "";
   BufferedReader reader =
      new BufferedReader(
         new InputStreamReader(
            response.getEntity().getContent()));
   String line1 = null;
   while ((line1 = reader.readLine()) != null){
      result += line1 + "\n";
   }
   // Checks if the pastebin and Log.txt contains the same information
   if( total.toString().equals(result)){
      display.setText(
         "The two files are the same \n Log.txt: " + total.toString() +
         "\n Pastebin: " + result);
   } else if(total.toString()!=result) {
      display.setText(
         "The two files arent the same \n Log.txt: " + total.toString() +
         "\n Pastebin: " + result); 
   }
</code></pre>

<p>So can anybody tell me what I have done wrong here since it says that it isn't the same?</p>
