1
我不能爲了我的生活找出原因,但我的谷歌帳戶意圖沒有出現在彈出的對話框中。這是我的代碼,如果需要,我可以提供更多。Google帳戶選取器沒有顯示出來
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);
}
}