如何从我的Android应用程序中打开Linkedin应用程序?

use*_*574 6 android linkedin android-intent

我可以从我的Android应用程序轻松打开facebook和twitter配置文件,如下所示:

           if (facebookId != null)
                    {
                        try
                        {
                            long longFacebookid = Long.parseLong(facebookId);

                            Intent intent = new Intent(Intent.ACTION_VIEW);
                            intent.setClassName("com.facebook.katana", "com.facebook.katana.ProfileTabHostActivity");
                            intent.putExtra("extra_user_id", longFacebookid);

                            startActivity(intent);

                            return;
                        }
                        catch (ActivityNotFoundException e)
                        {                       
                            e.printStackTrace();
                        }
                        catch (NumberFormatException e)
                        {   
                            e.printStackTrace();
                        }   
                    }
Run Code Online (Sandbox Code Playgroud)

但我不知道如何打开linkedin应用程序?有人知道Linkedin的类名吗?

多谢你们!

phi*_*s77 15

LinkedIn应用程序可以使用Intents打开,但API记录不是很好(根本没有?).工作URI是:

  • LinkedIn://你
  • linkedin://个人资料/ [个人资料ID]
  • linkedin:// group/[group id]

所以你可以使用:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("linkedin://you"));
final PackageManager packageManager = getContext().getPackageManager();
final List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (list.isEmpty()) {
    intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.linkedin.com/profile/view?id=you"));
}
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

我试图使用意图打开公司简介,但有一段时间但尚无结果.要获取配置文件ID,只需访问配置文件页面并检查URL.要获取公司ID,请访问https://developer.linkedin.com/apply-getting-started#company-lookup.


vie*_*eux 0

尝试the_id在 com.linked.android.profile.ViewProfileActivity 类上使用 putStringExtra("memberId", )