replaced (String == String) with String.equals(String)

This commit is contained in:
Philipp Schaefer
2013-04-03 00:24:35 +02:00
parent 090c9e6d2b
commit e396d7df1d
2 changed files with 3 additions and 4 deletions

View File

@ -42,7 +42,7 @@ public class IITC_Mobile extends Activity {
listener = new OnSharedPreferenceChangeListener() {
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key == "pref_force_desktop")
if (key.equals("pref_force_desktop"))
desktop = sharedPreferences.getBoolean("pref_force_desktop", false);
// reload intel map
iitc_view.loadUrl(addUrlParam("https://www.ingress.com/intel"));
@ -63,8 +63,7 @@ public class IITC_Mobile extends Activity {
if (Intent.ACTION_VIEW.equals(action)) {
Uri uri = intent.getData();
String url = uri.toString();
// TODO Why does "if(intent.getScheme() == "http")" not work?
if (url.contains("http://"))
if (intent.getScheme().equals("http://"))
url = url.replace("http://", "https://");
Log.d("Intent received", "url: " + url);
if (url.contains("ingress.com")) {

View File

@ -40,7 +40,7 @@ public class IITC_WebViewClient extends WebViewClient {
String iitc_version = "not found";
for (int i = 0; i < attributes.length; i++) {
// search vor version and use the value
if (attributes[i].contains("@version")) iitc_version = attributes[i+1];
if (attributes[i].equals("@version")) iitc_version = attributes[i+1];
}
return iitc_version;
}