LinkedIn Id为Android获取null

我使用以下代码片段来获取userdetail,但是从profile.getId()获取Id null
@Override
    protected void onNewIntent(Intent intent) {
        String verifier = intent.getData().getQueryParameter("oauth_verifier");

        LinkedInAccesstoken accesstoken = oAuthService.getoAuthAccesstoken(
                liToken,verifier);
        client = factory.createLinkedInapiclient(accesstoken);
        client.postNetworkUpdate("LinkedIn Android app test");
        Person profile = client.getProfileForCurrentUser();

        System.out.println("PersonID : " + profile.getId());
        System.out.println("Name : " + profile.getFirstName() + " "
                + profile.getLastName());
    }

请给我任何建议来获得它.

解决方法

我有解决方案,
我使用了以下代码片段来获取用户的更多详细信息,现在它正确地提供了所有内容,
Person profile = client.getProfileForCurrentUser(EnumSet.of(
                ProfileField.ID,ProfileField.FirsT_NAME,ProfileField.LAST_NAME,ProfileField.HEADLINE,ProfileField.INDUSTRY,ProfileField.PICTURE_URL,ProfileField.DATE_OF_BIRTH,ProfileField.LOCATION_NAME,ProfileField.MAIN_ADDRESS,ProfileField.LOCATION_COUNTRY));
        System.out.println("PersonID : " + profile.getId());
        System.out.println("Name : " + profile.getFirstName() + " "
                + profile.getLastName());
        System.out.println("Headline : " + profile.getHeadline());
        System.out.println("Industry : " + profile.getIndustry());
        System.out.println("Picture : " + profile.getPictureUrl());
        DateOfBirth dateOfBirth = profile.getDateOfBirth();
        System.out.println("DateOfBirth : " + dateOfBirth.getDay() + "/"
                + dateOfBirth.getMonth() + "/" + dateOfBirth.getYear());
        System.out.println("MAin Address : " + profile.getMainAddress());
        Location location = profile.getLocation();
        System.out.println("Location:" + location.getName() + " - "
                + location.getCountry().getCode());

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...