Example usage for com.google.api.client.googleapis.extensions.android.gms.auth GoogleAccountCredential getSelectedAccount

List of usage examples for com.google.api.client.googleapis.extensions.android.gms.auth GoogleAccountCredential getSelectedAccount

Introduction

In this page you can find the example usage for com.google.api.client.googleapis.extensions.android.gms.auth GoogleAccountCredential getSelectedAccount.

Prototype

public final Account getSelectedAccount() 

Source Link

Document

Returns the selected Google account or null for none.

Usage

From source file:com.google.drive.appdatapreferences.AppdataPreferencesSyncer.java

License:Open Source License

/**
 * Sets the credential and starts a periodic sync for the
 * selected account./*  w w  w  .ja va2s. c  o  m*/
 * @param credential User's credential
 */
public void setCredential(GoogleAccountCredential credential) {
    mCredential = credential;
    mSyncManager = new AppdataPreferencesSyncManager(credential.getSelectedAccount());
    mSyncManager.startPeriodicSync();
}