Example usage for android.accounts AccountManager removeAccount

List of usage examples for android.accounts AccountManager removeAccount

Introduction

In this page you can find the example usage for android.accounts AccountManager removeAccount.

Prototype

@Deprecated
public AccountManagerFuture<Boolean> removeAccount(final Account account,
        AccountManagerCallback<Boolean> callback, Handler handler) 

Source Link

Document

Removes an account from the AccountManager.

Usage

From source file:org.telegram.messenger.MessagesController.java

public void deleteAllAppAccounts() {
    try {/* w w  w.  java  2s .c  om*/
        AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
        Account[] accounts = am.getAccountsByType("org.telegram.messenger.account");
        for (Account c : accounts) {
            am.removeAccount(c, null, null);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}