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();
}
}
But I don't know how open linkedin application? Does somebody know the class name of Linkedin?
Thanks guys!
The LinkedIn app may be opened using Intents, but the API is not very well (at all?) documented. The working URIs are:
So you may use:
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);
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With