我怎样才能打开LinkedIn应用程序从我的Andr​​oid应用程序?应用程序、我的、LinkedIn、Andr

由网友(小拳王)分享简介:我从我的Andr​​oid应用程序像这样打开Facebook和Twitter的个人资料很容易I open facebook and twitter profile easily from my android application like this:if (facebookId != null){try{long...

我从我的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去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.

阅读全文

相关推荐

最新文章