REALLY added imprint link in settings; imprint and help links protected for bad confi...
authorDavid A. Velasco <dvelasco@solidgear.es>
Fri, 5 Jul 2013 12:00:41 +0000 (14:00 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Fri, 5 Jul 2013 12:00:41 +0000 (14:00 +0200)
src/com/owncloud/android/ui/activity/Preferences.java

index 26b1b6c..63ee14d 100644 (file)
@@ -106,9 +106,11 @@ public class Preferences extends SherlockPreferenceActivity implements OnPrefere
                 @Override
                 public boolean onPreferenceClick(Preference preference) {
                     String helpWeb   =(String) getText(R.string.url_help);
-                    Uri uriUrl = Uri.parse(helpWeb);
-                    Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
-                    startActivity(intent);
+                    if (helpWeb != null && helpWeb.length() > 0) {
+                        Uri uriUrl = Uri.parse(helpWeb);
+                        Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
+                        startActivity(intent);
+                    }
                     return true;
                 }
             });
@@ -162,22 +164,24 @@ public class Preferences extends SherlockPreferenceActivity implements OnPrefere
             });
         }
         
-        /*
         Preference pImprint =  findPreference("imprint");
-        if (pImprint != null){
+        if (pImprint != null) {
             pImprint.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                 @Override
                 public boolean onPreferenceClick(Preference preference) {
-                    /*String imprintWeb = (String) getText(R.string.url_imprint);
-                    Uri uriUrl = Uri.parse(imprintWeb);
-                    Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
-                    startActivity(intent);*-/
-                    ImprintDialog.newInstance(true).show(preference.get, "IMPRINT_DIALOG");
+                    String imprintWeb = (String) getText(R.string.url_imprint);
+                    if (imprintWeb != null && imprintWeb.length() > 0) {
+                        Uri uriUrl = Uri.parse(imprintWeb);
+                        Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
+                        startActivity(intent);
+                    }
+                    //ImprintDialog.newInstance(true).show(preference.get, "IMPRINT_DIALOG");
                     return true;
                 }
             });
+        }
             
-           /* About App */
+        /* About App */
        pAboutApp = (Preference) findPreference("about_app");
        if (pAboutApp != null) { 
                pAboutApp.setTitle(String.format(getString(R.string.about_android), getString(R.string.app_name)));