Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/Chromoting.java

Issue 213823003: Preserve account selection on rotating the device in Chromoting Android app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698