title: Add Account in AccountManager can lead to deadlock
body: <p>When I see that the user has no accounts in account manager I'm trying to do the following to send the user to the account settings activity and have them create an account.</p>
  
  <pre><code>AccountManagerFuture&lt;Bundle&gt; addAccount =
      accountManager.addAccount(ACCOUNT_TYPE, TOKEN,
                                                null,
                                                null,
                                                MyActivity.this, // activity
                                                null, // callback
                                                null); // handler
  Intent result = (Intent) addAccount.getResult().get(AccountManager.KEY_INTENT);
  startActivity(result);
  </code></pre>
  
  <p>This is throwing an <code>IllegalStateException</code> saying calling this from your main thread can lead to deadlock. What is the best way to perform this type of operation, and does anyone have a good code example of this in action?</p>