Check if any email account setup in android

前端 未结 1 867
星月不相逢
星月不相逢 2021-01-22 15:52

How can I check in android if any email account is set up?

相关标签:
1条回答
  • 2021-01-22 16:54

    You can use the AccountManager for checking the google accounts on an android phone :

        AccountManager am = AccountManager.get(getApplicationContext());
        Account[] accounts = am.getAccounts();
    
        for (Account account : accounts) {
        //do something with account
        }
    
    0 讨论(0)
提交回复
热议问题