我尝试应用找到here的解决方案,但我只拥有linkedIn配置文件的网址,而不是ID。此代码总是以
结尾String username = "bill-johnson"; // this is inferred from the full URL
public void toLinkedIn(){
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("linkedin://" + username));
final PackageManager packageManager = getPackageManager();
final List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (list.isEmpty()) {
// fall back on the full URL, which I also know.
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(LINKEDIN_URL));
}
startActivity(intent);
}
答案 0 :(得分:0)
LinkedIn的Android SDK提供了一个功能,可以直接在官方LinkedIn应用程序中“直接链接”个人资料。我建议您查看一下:https://developer.linkedin.com/docs/android-sdk#deeplink