X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/f79e2c0430b9b732d299cbb516c6884715d10e11..6ace8ab1c18b23a4c016986256075cfda8e50104:/src/com/owncloud/android/ui/activity/Preferences.java diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index cd87f31a..20c14bc6 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -19,6 +19,7 @@ package com.owncloud.android.ui.activity; import java.util.Vector; +import android.accounts.Account; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageInfo; @@ -32,7 +33,6 @@ import android.preference.Preference.OnPreferenceChangeListener; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceCategory; import android.preference.PreferenceManager; -import android.preference.PreferenceScreen; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockPreferenceActivity; @@ -41,8 +41,10 @@ import com.actionbarsherlock.view.MenuItem; import com.owncloud.android.Log_OC; import com.owncloud.android.OwnCloudSession; import com.owncloud.android.R; +import com.owncloud.android.authentication.AccountUtils; import com.owncloud.android.db.DbHandler; + /** * An Activity that allows the user to change the application's settings. * @@ -140,14 +142,14 @@ public class Preferences extends SherlockPreferenceActivity implements OnPrefere Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setType("text/plain"); - //Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(Preferences.this); + 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); + 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)); + 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)));