我怎样才能打开LinkedIn应用程序从我的Andr​​oid应用程序? [英] How can I open Linkedin application from my android app?

查看:139
本文介绍了我怎样才能打开LinkedIn应用程序从我的Andr​​oid应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的Andr​​oid应用程序像这样打开Facebook和Twitter的个人资料很容易

I open facebook and twitter profile easily from my android application like this:

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

但我不知道怎么开口LinkedIn应用程序?是否有人知道LinkedIn之类的名字?

But I don't know how open linkedin application? Does somebody know the class name of Linkedin?

谢谢你们!

推荐答案

LinkedIn的应用程序可以使用意图被打开,但是API不是很好(在所有?)记录。 工作URI是:

The LinkedIn app may be opened using Intents, but the API is not very well (at all?) documented. The working URIs are:

  • 在LinkedIn://你
  • 在LinkedIn://资料/ [简介ID]
  • 在LinkedIn://组/ [组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);

我试图打开使用,因为一段时间的意图,但没有结果,但公司资料。 为了获得资料编号:只需访问个人资料页和查询的网址。 为了获得该公司ID去<一href="https://developer.linkedin.com/apply-getting-started#company-lookup">https://developer.linkedin.com/apply-getting-started#company-lookup.

I'm trying to open a company profile using intents since some time but no result yet. To obtain the profile id just visit the profile page and check the URL. To get the company id go to https://developer.linkedin.com/apply-getting-started#company-lookup.

这篇关于我怎样才能打开LinkedIn应用程序从我的Andr​​oid应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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