我正在尝试使用 Android 中的应用程序通过 URL 或成员(member) ID 打开 Linkedin 个人资料。
我试试这个:
Intent linkedinIntent = new Intent(Intent.ACTION_VIEW);
linkedinIntent.setClassName("com.linkedin.android", "com.linkedin.android.profile.ViewProfileActivity");
linkedinIntent.putExtra("memberId", <member id>);
startActivity(linkedinIntent);
但此代码只是打开 Linkedin 应用程序。
如何打开特定的配置文件?
最佳答案
try {
getPackageManager().getPackageInfo("com.linkedin.android", 0);
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("linkedin://profile/yourID"));
}catch (Exception e) {
showerror(); // handle exception
}finally {
startActivity(intent);
}
关于android - 如何在 Android 中使用应用程序打开用户个人资料 Linkedin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14893422/