类名通过意图LinkedIn只分享 [英] Class name to Share via Intent to LinkedIn only
问题描述
我目前在Android应用创造直接意图来选择的流行平台分享一些文本的过程。目前我正在试图获得一个直接故意与LinkedIn合作。
I am currently in the process of creating direct intents to a selection of popular platforms in an Android app to share some text. I am currently trying to get a direct intent working with LinkedIn.
我目前得到了直接故意Twitter的工作,像这样:
I have currently got a direct intent working for Twitter like so:
shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setClassName("com.twitter.android",
"com.twitter.android.PostActivity");
shareIntent.setType("text/*");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, text);
startActivityForResult(shareIntent, 9);
我现在需要的是LinkedIn一样的。到目前为止,我所知道的基本软件包LinkedIn在互联网上搜索后。这是com.linkedin.android(请纠正我,如果这是错误的)。不过,我错过了关键的部分是用在LinkedIn应用程序共享交易的类的名称。即com.linkedin.android?
What I need now is the same for LinkedIn. So far I know the base package for LinkedIn after searching on the internet. That being "com.linkedin.android" (Please correct me if this is wrong). However, the key part I am missing is the name of the class that deals with sharing in the LinkedIn app. I.e. com.linkedin.android.?.
推荐答案
我设法通过提取来自APK LinkedIn的清单文件找到的意图。
I managed to find the intent by extracting the LinkedIn Manifest file from the APK.
类名称为: com.linkedin.android.home.UpdateStatusActivity
我的code的人感兴趣的是:
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();
}
感谢雷沙德雷WISNIEWSKI他对工作的http:// code .google.com / p / Android的apktool /
这篇关于类名通过意图LinkedIn只分享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!