List of usage examples for android.accounts AccountManager addAccount
public AccountManagerFuture<Bundle> addAccount(final String accountType, final String authTokenType, final String[] requiredFeatures, final Bundle addAccountOptions, final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler)
From source file:net.heroicefforts.viable.android.rep.it.GIssueTrackerRepository.java
private void manageAccount() { AccountManager accMgr = (AccountManager) act.getSystemService(Context.ACCOUNT_SERVICE); if (Config.LOGD) Log.d(TAG, "Requesting account creation."); Account[] accts = accMgr.getAccountsByType(GCLAccountAuthenticator.ACCT_TYPE); if (accts.length > 0) accMgr.confirmCredentials(accts[0], null, act, callback, null); else// w w w. ja v a 2 s. c om accMgr.addAccount(GCLAccountAuthenticator.ACCT_TYPE, GCLAccountAuthenticator.TOKEN_TYPE_ISSUE_TRACKER, null, null, act, callback, null); }
From source file:com.synox.android.ui.activity.FileActivity.java
/** * Launches the account creation activity. To use when no ownCloud account is available *///from w w w . j a va2 s. co m private void createFirstAccount() { AccountManager am = AccountManager.get(getApplicationContext()); am.addAccount(MainApp.getAccountType(), null, null, null, this, new AccountCreationCallback(), null); }