Code example for AccountManagerFuture

Methods: getResult, isCancelled

0
    private static AccountManagerCallback<Bundle> getAccountManagerCallback(
            final Activity activity) {
        return new AccountManagerCallback<Bundle>() {
            @Override 
            public void run(AccountManagerFuture<Bundle> future) {
                if (future.isCancelled()) {
                    // The account creation process was canceled 
                    activity.finish();
                    return; 
                } 
                try { 
                    Bundle result = future.getResult();
                    if (result.getBoolean(KEY_USER_SKIPPED_ACCOUNT_SETUP)) {
                        AccountPromptUtils.neverShowAccountPromptAgain(activity);
                    } 
                } catch (OperationCanceledException ignore) {
                    Log.e(TAG, "Account setup error: account creation process canceled");
                } catch (IOException ignore) {
                    Log.e(TAG, "Account setup error: No authenticator was registered for this"
                            + "account type or the authenticator failed to respond"); 
                } catch (AuthenticatorException ignore) {