Class name to Share via Intent to LinkedIn only

天大地大妈咪最大 提交于 2019-12-01 22:35:36

I managed to find the intent by extracting the LinkedIn Manifest file from the APK.

The class name is: com.linkedin.android.home.UpdateStatusActivity

My code for anyone interested is:

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

Credit to Ryszard Wiśniewski for his work on http://code.google.com/p/android-apktool/

As of my writing, the new class name is:

com.linkedin.android.infra.deeplink.DeepLinkHelperActivity

So all together:

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setClassName("com.linkedin.android",
        "com.linkedin.android.infra.deeplink.DeepLinkHelperActivity"); 
shareIntent.setType("text/*");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareText);           
startActivity(shareIntent);

It is com.linkedin.android.publishing.sharing.ShareActivity , you can download this app and see what is the current Activity name thats running on your phone https://play.google.com/store/apps/details?id=com.willme.topactivity ... But com.linkedin.android.publishing.sharing.ShareActivity seems its a private class and you can't access as you access Twitter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!