Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/Chromoting.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java |
| index 9a477b009333f72f78fa5d5f7dd600658b698ea0..d89b92c42faa2061591da303b43814d91abe29f1 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. |
|
Jamie
2014/03/27 02:06:32
Is this comment still accurate?
Lambros
2014/03/27 02:13:19
Yes. The font styles in the spinner are defined to
|
| if (mAccounts.length != 1) { |
| - AccountsAdapter adapter = new AccountsAdapter(this, mAccounts); |
| - getActionBar().setListNavigationCallbacks(adapter, this); |
| + mAccountsAdapter.notifyDataSetChanged(); |
| } |
| } |