AccountManager不会在Android N预览中添加自定义帐户 [英] AccountManager does not add custom account in Android N preview

本文介绍了AccountManager不会在Android N预览中添加自定义帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在我的应用中实现了同步适配器,该适配器要求在设备帐户设置中添加一个帐户.我遵循了Android文档中提供的相同方法.直到棉花糖都可以正常工作,我可以在设备帐户中看到我的帐户.但是在Android N预览中,帐户不会添加到设备帐户中. AccountManager的addAccountExplicitly()方法始终返回false.有人遇到过这个问题吗?

I have implemented a sync adapter in my app which requires an account to be added in the device account settings. I followed the same approach given in the Android docs. It works fine till Marshmallow and I can see my account listed in the device accounts. But in Android N preview, account does not add to the device accounts. AccountManager's addAccountExplicitly() method always returns false. Has anyone faced this problem?

推荐答案

不确定这是否是相同的问题,但是当前版本的Android N映像的AccountManager存在问题.基本上,如果您:

Not sure if this is the same issue, but there's an issue with AccountManager on the current version of the Android N image. Basically, if you:

  1. 将帐户添加到AccountManager
  2. 卸载应用
  3. 重新安装应用
  4. 尝试再次添加帐户

这将失败,并且您将在日志中看到以下内容:

This will fail and you'll see the following in the log:

W/AccountManagerService( 1503): insertAccountIntoDatabase: Account {name=foo@bar.com, type=com.foo.bar}, skipping since the account already exists

W/AccountManagerService( 1503): insertAccountIntoDatabase: Account {name=foo@bar.com, type=com.foo.bar}, skipping since the account already exists

这是一个已知问题,并已报告给Google: https://code.google.com/p/android/issues/detail ?id = 210992 https://code.google.com/p/android/issues/detail ?id = 210951

This is a known issue and it's been reported to Google: https://code.google.com/p/android/issues/detail?id=210992 https://code.google.com/p/android/issues/detail?id=210951

这篇关于AccountManager不会在Android N预览中添加自定义帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆