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?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Has this been fixed now in the latest Android N release.
I have totally the same issue. I could fix it by manually going to the application settings and enabling Сontacts permission. I don't know how, but after that I was able to use
addAccountExplicitly()
method without issues. I even disabled that permission again and cleared app data but it still was working properly...After app was reinstalled - problem appeared again.
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:
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
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