2012-06-15 12 views
7

अशक्त हो रही मैं निम्नलिखित कोड का टुकड़ा का उपयोग कर रहा userdetail प्राप्त करने के लिए, लेकिन ईद अशक्त हो रही से profile.getId()लिंक्डइन ईद के लिए एंड्रॉयड

@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()); 
    } 

मुझे इसे पाने के लिए कोई सुझाव दे कृपया।

उत्तर

11

मैं इस के लिए समाधान मिल गया है, मैं कोड स्निपेट निम्न उपयोगकर्ता के लिए और अधिक विस्तार पाने के लिए और अब यह सब ठीक से दे रहा है का इस्तेमाल किया है,

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()); 
+0

मैं उपयोगकर्ता में जुड़े हुए के लिए प्रोफ़ाइल तस्वीर कैसे मिलता है ? – Kirthiga

संबंधित मुद्दे