From b708d46defe3f3596167e9ef9e71c4efacba8d49 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Fri, 5 Jul 2013 14:00:41 +0200 Subject: [PATCH] REALLY added imprint link in settings; imprint and help links protected for bad configuration of preferences.xml --- .../owncloud/android/ui/activity/Preferences.java | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 26b1b6c6..63ee14df 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -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))); -- 2.11.0