Reputation: 5574
I want to get configured accounts count without any user intervention. I was using AccountManager.getAccounts()
function before API level 26 and was working fine.
But as GET_ACCOUNTS permission behavior has been changed in API 26, it will prompt user the list of accounts on device before getting access to them. accountManager.newChooseAccountIntent()
My requirement is to check if any account is configured on account on which I have to perform tasks(No user interaction). Is there any way I can check(no. of accounts) the same other than prompting user to choose accounts.
I have already referred to the below tickets but couldn't find any way to do the same without user consent:
AccountManager.getAccounts() not working in targetsdk > 23
Pick an email using AccountPicker.newChooseAccountIntent
Upvotes: 1
Views: 392