Code example for SparseArray

Methods: clonesize

0
     */ 
    public void dismissAutoLogins(String accountName, String authToken, boolean success,
            String result) {
        // Use a copy of the current active accounts so we can delete the 
        // original in the for loop. 
        SparseArray<AutoLoginAccountDelegate> accountInfo = mAccountHelpers.clone();
        for (int i = 0; i < accountInfo.size(); i++) {
            int infoBar = accountInfo.keyAt(i);
            AutoLoginAccountDelegate delegate = accountInfo.get(infoBar);
            if (!delegate.loginRequested()) {
                nativeLoginDismiss(infoBar);
            } else { 
                String accountAuthToken = delegate.getAuthToken();
                if (accountAuthToken != null && accountAuthToken.equals(authToken)
                        && delegate.loginRequested()) {
                    if (success) {
                        nativeLoginSuccess(infoBar, result);
                    } else { 
                        nativeLoginFailed(infoBar);
                    }