我是Android新手。我想将LinkedIn份额集成到我的Android应用程序中。整合LinkedIn份额的最佳方法是哪种?
谢谢。
答案在这里:
Class name to Share via Intent to LinkedIn only
if(Utils.doesPackageExist(getSherlockActivity(), "com.linkedin.android"))
{
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setClassName("com.linkedin.android",
"com.linkedin.android.home.UpdateStatusActivity");
shareIntent.setType("text/*");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareText);
startActivity(shareIntent);
}
else
{
Toast.makeText(getSherlockActivity(), "Please install the LinkedIn app to share your result", Toast.LENGTH_LONG).show();
}
使用以下URL共享Linkedin URL。分享所需要做的就是在下面插入您的URL ...
https://www.linkedin.com/sharing/share-offsite/?url={url}
不过,该URL在过去几年中已多次更改。如果您不想再为此担心,请查看此回购,社区会定期跟踪和更新URL:Github: Social Share URLs。