如何将Linkedin Share集成到Android应用中

问题描述 投票:2回答:2

我是Android新手。我想将LinkedIn份额集成到我的Android应用程序中。整合LinkedIn份额的最佳方法是哪种?

谢谢。

android share linkedin
2个回答
0
投票

答案在这里:

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

0
投票

使用以下URL共享Linkedin URL。分享所需要做的就是在下面插入您的URL ...

https://www.linkedin.com/sharing/share-offsite/?url={url}

不过,该URL在过去几年中已多次更改。如果您不想再为此担心,请查看此回购,社区会定期跟踪和更新URL:Github: Social Share URLs

Social Share URLs

© www.soinside.com 2019 - 2024. All rights reserved.