Code example for AccountManager

Methods: addAccount

     * If something goes wrong -the RESULT_CANCELED flag is set, an Intent with 
     * a message is sent to the caller's onActivityResult() method and the 
     * activity is destroyed. 
    public void onClick(final View v) {
	this.mAccountManager.addAccount("", null, null,
		null /* options */, this,
		new AddGoogleAccountManagerCallback(), null /* handler */); 
    public void onAccountsUpdated(final Account[] accounts) {
        this.mAccountsListView.setAdapter(new AccountArrayAdapter(this, accounts));
Stop searching for code, let great code find you!  Add Codota to your java IDE