From a6e98cc7dc4c7f765f442015b1ac793e63884b75 Mon Sep 17 00:00:00 2001 From: Lennart Rosam Date: Tue, 10 Apr 2012 00:37:31 +0200 Subject: [PATCH] Display the account name in preferences --- src/eu/alefzero/owncloud/ui/activity/Preferences.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/eu/alefzero/owncloud/ui/activity/Preferences.java b/src/eu/alefzero/owncloud/ui/activity/Preferences.java index 1e35896cee..3677f8aef4 100644 --- a/src/eu/alefzero/owncloud/ui/activity/Preferences.java +++ b/src/eu/alefzero/owncloud/ui/activity/Preferences.java @@ -24,6 +24,7 @@ import java.util.Vector; import eu.alefzero.owncloud.OwnCloudSession; import eu.alefzero.owncloud.R; import eu.alefzero.owncloud.authenticator.AccountAuthenticator; +import eu.alefzero.owncloud.authenticator.AuthUtils; import eu.alefzero.owncloud.db.DbHandler; import android.accounts.Account; @@ -98,6 +99,12 @@ public class Preferences extends PreferenceActivity { mAccounts = accMan.getAccountsByType(AccountAuthenticator.ACCOUNT_TYPE); ListPreference accountList = (ListPreference) findPreference("select_oc_account"); + // Display the name of the current account if there is any + Account defaultAccount = AuthUtils.getCurrentOwnCloudAccount(this); + if(defaultAccount != null){ + accountList.setSummary(defaultAccount.name); + } + // Transform accounts into array of string for preferences to use String[] accNames = new String[mAccounts.length]; for(int i = 0; i < mAccounts.length; i++){