+
+ return true;
+ }
+ });
+
+ }
+
+ Preference pHelp = findPreference("help");
+ if (pHelp != null ){
+ pHelp.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+ @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);
+ return true;
+ }
+ });
+ }
+
+ Preference pRecommend = findPreference("recommend");
+ if (pRecommend != null){
+ pRecommend.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+
+ Intent intent = new Intent(Intent.ACTION_SENDTO);
+ intent.setType("text/plain");
+ //Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(Preferences.this);
+ String appName = getString(R.string.app_name);
+ //String username = currentAccount.name.substring(0, currentAccount.name.lastIndexOf('@'));
+ //String recommendSubject = String.format(getString(R.string.recommend_subject), username, appName);
+ String recommendSubject = String.format(getString(R.string.recommend_subject), appName);
+ intent.putExtra(Intent.EXTRA_SUBJECT, recommendSubject);
+ //String recommendText = String.format(getString(R.string.recommend_text), getString(R.string.app_name), username);
+ String recommendText = String.format(getString(R.string.recommend_text), getString(R.string.app_name), getString(R.string.url_app_download));
+ intent.putExtra(Intent.EXTRA_TEXT, recommendText);
+
+ intent.setData(Uri.parse(getString(R.string.mail_recommend)));
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(intent);
+
+
+ return(true);
+
+ }
+ });
+ }
+ Preference pFeedback = findPreference("feedback");
+ if (pFeedback != null){
+ pFeedback.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ String feedbackMail =(String) getText(R.string.mail_feedback);
+ String feedback =(String) getText(R.string.prefs_feedback);
+ Intent intent = new Intent(Intent.ACTION_SENDTO);
+ intent.setType("text/plain");
+ intent.putExtra(Intent.EXTRA_SUBJECT, feedback);
+
+ intent.setData(Uri.parse(feedbackMail));
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(intent);
+
+ return true;
+ }
+ });
+ }
+
+ /*
+ Preference pImprint = findPreference("imprint");
+ 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");