From 15f2d5e43fe90f2bafa08168ad5a9280ce169fc0 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 14 May 2014 23:02:33 +0200 Subject: [PATCH] Fixed lint problems. --- build.gradle | 2 +- .../com/nutomic/syncthingandroid/SettingsActivity.java | 8 ++++++++ .../java/com/nutomic/syncthingandroid/WebGuiActivity.java | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a92e0e1e..acb16509 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ repositories { } dependencies { - compile 'com.android.support:appcompat-v7:18.0.+' + compile 'com.android.support:appcompat-v7:19.1.+' } android { diff --git a/src/main/java/com/nutomic/syncthingandroid/SettingsActivity.java b/src/main/java/com/nutomic/syncthingandroid/SettingsActivity.java index aaa6c9a8..6715577a 100644 --- a/src/main/java/com/nutomic/syncthingandroid/SettingsActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/SettingsActivity.java @@ -1,5 +1,7 @@ package com.nutomic.syncthingandroid; +import android.annotation.SuppressLint; +import android.annotation.TargetApi; import android.content.Intent; import android.net.Uri; import android.os.Build; @@ -18,7 +20,13 @@ public class SettingsActivity extends PreferenceActivity { private static final String SYNCTHING_VERSION_KEY = "syncthing_version"; + /** + * Loads layout, sets version from Rest API. + * + * Manual target API as we manually check if ActionBar is available (for ActionBar back button). + */ @Override + @TargetApi(11) public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/src/main/java/com/nutomic/syncthingandroid/WebGuiActivity.java b/src/main/java/com/nutomic/syncthingandroid/WebGuiActivity.java index 8e59b49a..1982fe90 100644 --- a/src/main/java/com/nutomic/syncthingandroid/WebGuiActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/WebGuiActivity.java @@ -1,5 +1,6 @@ package com.nutomic.syncthingandroid; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.content.ComponentName; @@ -90,7 +91,13 @@ public class WebGuiActivity extends Activity { } }; + /** + * Initialize WebView. + * + * Ignore lint javascript warning as js is loaded only from our known, local service. + */ @Override + @SuppressLint("SetJavaScriptEnabled") public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getApplicationContext().startService(