是否可以获得在 Android 设备中使用 PlayStore 应用程序配置的 Yahoo/Microsoft 电子邮件 ID/ID。我为雅虎使用com.yahoo.mobile.client.share.sync。但不工作。我可以知道实现目标的正确方法是什么吗?
这是我的代码:
public String[] allemails()
{
_accountMgr = AccountManager.get(getActivity());
// Account [] accounts = _accountMgr.getAccounts();
// Account [] accounts = _accountMgr.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
Account [] accounts = _accountMgr.getAccountsByType("com.yahoo.mobile.client.share.sync");
numberOfEmail = accounts.length ;
String [] emailAddress = new String[numberOfEmail];
r = 0;
for (Account account : accounts) {
accountsList = account.name.toString();
emailAddress[r] = accountsList;
r += 1;
}
MyAlertDialog f = new MyAlertDialog();
Bundle args = new Bundle();
args.putStringArray("Title", emailAddress);
f.setArguments(args);
return emailAddress;
}