From: David A. Velasco Date: Fri, 5 Jul 2013 12:00:41 +0000 (+0200) Subject: REALLY added imprint link in settings; imprint and help links protected for bad confi... X-Git-Tag: oc-android-1.5.5~159^2~1^2~3 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/b708d46defe3f3596167e9ef9e71c4efacba8d49?ds=inline;hp=--cc REALLY added imprint link in settings; imprint and help links protected for bad configuration of preferences.xml --- b708d46defe3f3596167e9ef9e71c4efacba8d49 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)));