我怎样才能获得雅虎/微软帐户的电子邮件ID [英] How Can I Get email ids of Yahoo/Microsoft Account

查看:297
本文介绍了我怎样才能获得雅虎/微软帐户的电子邮件ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能获得被配置在Android设备Play商店中的应用程序雅虎/微软的电子邮件ID / IDS。我使用 com.yahoo.mobile.client.share.sync 雅虎。但不工作。可能我知道什么是实现我的目标,正确的方法是什么?

下面是我的code:

 公共字符串[] allemails()
        {             _accountMgr = AccountManager.get(getActivity());
               //帐户[] =帐户_accountMgr.getAccounts();              //帐户[] =帐户_accountMgr.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
             帐户[] =帐户_accountMgr.getAccountsByType(com.yahoo.mobile.client.share.sync);             numberOfEmail = accounts.length;
                的String [] = EMAILADDRESS新的String [numberOfEmail]                R = 0;
                对于(账户账号:账号){
                    accountsList = account.name.toString();
                    EMAILADDRESS [R] = accountsList;
                    R + = 1;                }                MyAlertDialog F =新MyAlertDialog();
                捆绑ARGS =新包();
                args.putStringArray(标题,EMAILADDRESS);
                f.setArguments(参数);                返回EMAILADDRESS;
        }


解决方案

替换帐户类型


  

com.yahoo.mobile.cllient.share.sync



  

com.yahoo.mobile.client.share.account


Is it possible to get Yahoo/Microsoft email id/ ids which are configured with PlayStore app in android device. I use com.yahoo.mobile.client.share.sync for Yahoo. But Not Working .May I know what is the correct way to achieve my objective?

Here is my code:

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;
        }

解决方案

Replace the account type

com.yahoo.mobile.cllient.share.sync

to

com.yahoo.mobile.client.share.account

这篇关于我怎样才能获得雅虎/微软帐户的电子邮件ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆