Example usage for android.accounts Account equals

List of usage examples for android.accounts Account equals

Introduction

In this page you can find the example usage for android.accounts Account equals.

Prototype

public boolean equals(Object o) 

Source Link

Usage

From source file:com.synox.android.ui.activity.FileActivity.java

/**
 * Tries to swap the current ownCloud {@link Account} for other valid and existing.
 * <p/>//  w  w  w .j a v  a 2 s.c  o m
 * If no valid ownCloud {@link Account} exists, the the user is requested
 * to create a new ownCloud {@link Account}.
 * <p/>
 * POSTCONDITION: updates {@link #mAccountWasSet} and {@link #mAccountWasRestored}.
 */
private void swapToDefaultAccount() {
    // default to the most recently used account
    Account newAccount = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
    if (newAccount == null) {
        /// no account available: force account creation
        createFirstAccount();
        mRedirectingToSetupAccount = true;
        mAccountWasSet = false;
        mAccountWasRestored = false;

    } else {
        mAccountWasSet = true;
        mAccountWasRestored = (newAccount.equals(mAccount));
        mAccount = newAccount;
    }
}