mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 14:45:47 +03:00
Display the account name in preferences
This commit is contained in:
parent
cf2c2eedc5
commit
a6e98cc7dc
1 changed files with 7 additions and 0 deletions
|
@ -24,6 +24,7 @@ import java.util.Vector;
|
||||||
import eu.alefzero.owncloud.OwnCloudSession;
|
import eu.alefzero.owncloud.OwnCloudSession;
|
||||||
import eu.alefzero.owncloud.R;
|
import eu.alefzero.owncloud.R;
|
||||||
import eu.alefzero.owncloud.authenticator.AccountAuthenticator;
|
import eu.alefzero.owncloud.authenticator.AccountAuthenticator;
|
||||||
|
import eu.alefzero.owncloud.authenticator.AuthUtils;
|
||||||
import eu.alefzero.owncloud.db.DbHandler;
|
import eu.alefzero.owncloud.db.DbHandler;
|
||||||
|
|
||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
|
@ -98,6 +99,12 @@ public class Preferences extends PreferenceActivity {
|
||||||
mAccounts = accMan.getAccountsByType(AccountAuthenticator.ACCOUNT_TYPE);
|
mAccounts = accMan.getAccountsByType(AccountAuthenticator.ACCOUNT_TYPE);
|
||||||
ListPreference accountList = (ListPreference) findPreference("select_oc_account");
|
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
|
// Transform accounts into array of string for preferences to use
|
||||||
String[] accNames = new String[mAccounts.length];
|
String[] accNames = new String[mAccounts.length];
|
||||||
for(int i = 0; i < mAccounts.length; i++){
|
for(int i = 0; i < mAccounts.length; i++){
|
||||||
|
|
Loading…
Reference in a new issue