AccountManager returns empty accounts

I have an application that implements my own Authenticator, as described in this article. And it works just as intended. Now I need to get the google account from AccountManager, and I do it as follows:

 Account[] accounts = AccountManager.get(this).getAccountsByType("com.google");

The problem is that it returns an empty array. But when I use this snippet in my test application without any means of authentication, it works like a charm. I do not see where the actual difference is between these cases. Has anyone encountered this problem?

+4
source share
1 answer

, GET_ACCOUNTS. , .

, GET_ACCOUNTS - . , , GET_ACCOUNTS, ( , ).

, AccountPicker ( Google Play), . ( ).

+6

Source: https://habr.com/ru/post/1619037/


All Articles