2013-02-15 56 views
2

我正在尝试在Android中使用URL或成员ID在应用程序中打开Linkedin配置文件。
我试试这个:如何在android中使用应用程序打开用户配置文件Linkedin

Intent linkedinIntent = new Intent(Intent.ACTION_VIEW); 
linkedinIntent.setClassName("com.linkedin.android", "com.linkedin.android.profile.ViewProfileActivity"); 
linkedinIntent.putExtra("memberId", <member id>); 
startActivity(linkedinIntent); 

但是这个代码只是打开了LinkedIn应用。
如何打开特定配置文件?

回答

0

根据LinkedIn Developer论坛上的帖子,这个功能没有被他们的API公开。

来源:

  1. http://developer.linkedin.com/forum/android-intent
  2. http://developer.linkedin.com/forum/mobile-user-profile-url

然而,这似乎工作的无证方法。当然,它可能会有一个疏忽,因为它没有记录,它可能会也可能不会发生变化,所以它已经放弃了使用和使用这个自然而然的警告。如果确实发生了变化,它可能会破坏你的应用程序的功能

说了这么多,LinkedIn的员工建议:https://developer.linkedin.com/comment/3614#comment-3614已经披露了上述未公开的功能。

http://www.linkedin.com/x/profile/{consumer-key}/{member-token} 

祝你好运,希望LinkedIn能够通过他们的API提供这样一个功能(简单,不知何故,仍然被忽略)。

3
try { 
      getPackageManager().getPackageInfo("com.linkedin.android", 0); 
      intent = new Intent(Intent.ACTION_VIEW, Uri.parse("linkedin://profile/yourID")); 
    }catch (Exception e) { 
      intent = new Intent(Intent.ACTION_VIEW, Uri.parse(AboutScreenURLs.LINKEDIN)); 
    }finally { 
     startActivity(intent); 
} 
+0

WTH是'AboutScreenURLs'? – VSG24 2017-07-02 13:29:55

相关问题