diff options
Diffstat (limited to 'remoting/android')
-rw-r--r-- | remoting/android/java/src/org/chromium/chromoting/Chromoting.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java index 9a477b0..d89b92c 100644 --- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java +++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java @@ -61,6 +61,9 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe /** List of accounts on the system. */ private Account[] mAccounts; + /** SpinnerAdapter used in the action bar for selecting accounts. */ + private AccountsAdapter mAccountsAdapter; + /** Account auth token. */ private String mToken; @@ -191,9 +194,9 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe getActionBar().setTitle(R.string.mode_me2me); getActionBar().setSubtitle(mAccount.name); } else { - AccountsAdapter adapter = new AccountsAdapter(this, mAccounts); + mAccountsAdapter = new AccountsAdapter(this, mAccounts); getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); - getActionBar().setListNavigationCallbacks(adapter, this); + getActionBar().setListNavigationCallbacks(mAccountsAdapter, this); getActionBar().setSelectedNavigationItem(index); } @@ -215,8 +218,7 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe // Reload the spinner resources, since the font sizes are dependent on the screen // orientation. if (mAccounts.length != 1) { - AccountsAdapter adapter = new AccountsAdapter(this, mAccounts); - getActionBar().setListNavigationCallbacks(adapter, this); + mAccountsAdapter.notifyDataSetChanged(); } } |