Skip to content

Commit

Permalink
Move some code from onCreate() to onStart() in Chromoting Android app
Browse files Browse the repository at this point in the history
This reloads the system's accounts list whenever the app is started
(so if the user adds an account, then switches back to the app, the
change will be reflected).

This also reloads the host list, which will alleviate many of the
problems with stale OAuth tokens such as in bug 304719.

BUG=304719
NOTRY=true

Review URL: https://codereview.chromium.org/212673010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259763 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
lambroslambrou@chromium.org committed Mar 27, 2014
1 parent 777e941 commit be3da68
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions remoting/android/java/src/org/chromium/chromoting/Chromoting.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ public void onCreate(Bundle savedInstanceState) {

// Bring native components online.
JniInterface.loadLibrary(this);
}

/**
* Called when the activity becomes visible. This happens on initial launch and whenever the
* user switches to the activity, for example, by using the window-switcher or when coming from
* the device's lock screen.
*/
@Override
public void onStart() {
super.onStart();

mAccounts = AccountManager.get(this).getAccountsByType(ACCOUNT_TYPE);
if (mAccounts.length == 0) {
Expand Down

0 comments on commit be3da68

Please sign in to comment.