Code example for SparseArray

Methods: remove

0
    /** 
     * Clear account information for cancelled login requests. 
     */ 
    @CalledByNative 
    boolean cancelLogIn(int nativeInfoBar) {
        mAccountHelpers.remove(nativeInfoBar);
        return true; 
    } 
 
    /** 
     * Clear all infobars in the same tab and tells native to proceed with login if successful. 
     */ 
    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);