ContactAdderActivity.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:kidsdialer 作者:
/**
 * Updates account list spinner when the list of Accounts on the system
 * changes. Satisfies OnAccountsUpdateListener implementation.
 */
public void onAccountsUpdated(Account[] a) {
    Log.i("Account list update detected");
    // Clear out any old data to prevent duplicates
    mAccounts.clear();

    // Get account data from system
    AuthenticatorDescription[] accountTypes = AccountManager.get(this)
            .getAuthenticatorTypes();

    // Populate tables
    for (int i = 0; i < a.length; i++) {
        // The user may have multiple accounts with the same name, so we
        // need to construct a
        // meaningful display name for each.
        String systemAccountType = a[i].type;
        AuthenticatorDescription ad = getAuthenticatorDescription(
                systemAccountType, accountTypes);
        AccountData data = new AccountData(a[i].name, ad);
        mAccounts.add(data);
    }

    // Update the account spinner
    mAccountAdapter.notifyDataSetChanged();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号