1

I can not for the life of me figure out why, but my google account intent isn't showing up in a popup dialog. Here is my code and I can provide more of it if needed.

public class MainMenu extends ActionBarActivity implements ActionBar.TabListener {
//... Fragment Code
Intent googlePicker = AccountPicker.newChooseAccountIntent(null, null,
            new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE}, true, null, null, null, null);
    startActivityForResult(googlePicker, 1);
}

@Override
protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
    if (requestCode == 1 && resultCode == RESULT_OK) {
        String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
        Log.d(this.getClass().toString(), "Account Name=" + accountName);
    }
}
Dean Galvin
  • 169
  • 1
  • 11

1 Answers1

2

If you are in a Fragment use

...
getActivity().startActivityForResult(googlePicker, 1);
...
flosk8
  • 465
  • 1
  • 6
  • 17