List of usage examples for android.accounts AccountManager removeAccount
@Deprecated public AccountManagerFuture<Boolean> removeAccount(final Account account, AccountManagerCallback<Boolean> callback, Handler handler)
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(); } }