user834900
user834900

Reputation:

How to integrate Linkedin Share on android app

I am new in Android. I want to integrate LinkedIn share on my Android application. Which is the best way to integrate LinkedIn share?

Thanks.

Upvotes: 2

Views: 4143

Answers (2)

HoldOffHunger
HoldOffHunger

Reputation: 20881

Use the following URL to share a Linkedin URL. All you need to do to share is insert your URL below...

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

This URL has changed, though, several times in the past years. If you don't want to worry about that anymore, check out this repo, where URL's are regularly tracked and updated by the community: Github: Social Share URLs.

Social Share URLs

Upvotes: 0

Psypher
Psypher

Reputation: 10829

Answer is here:

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

Upvotes: 1

Related Questions