【发布时间】:2011-07-12 16:45:28
【问题描述】:
我目前正在使用 Android 的 AccountManager 类检索用户的 gmail 用户名。 我的问题是我的应用程序假定用户已经将他的 Google 帐户添加到他的 Android 手机,我想问是否可以启动帐户和同步设置应用程序以防用户实际上没有绑定他的 Google 帐户到他的手机?
AccountManager accountManager = AccountManager.get(getApplicationContext());
Account[] accounts = accountManager.getAccountsByType("com.google");
if (accounts.length == 0) // How?
// run Accounts & sync settings so that the user can add his Google account
【问题讨论】:
标签: android