Эх сурвалжийг харах

Display the account name in preferences

Lennart Rosam 13 жил өмнө
parent
commit
a6e98cc7dc

+ 7 - 0
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++){