【发布时间】:2016-05-07 02:09:13
【问题描述】:
我正在尝试从我的应用程序中打开一个 facebook 应用程序,但我需要将它转到特定用户的时间线。我可以在手机浏览器中打开它,它工作正常,但我无法在 facebook 应用程序中打开它......我知道 facebook 改变了以前的方式,我正在使用 facebook-android-sdk:4.6.0 这是我的代码:
public Intent getOpenFacebookIntent(String userId) {
Log.e(TAG, "pid "+ userId);
try {
getPackageManager().getPackageInfo("com.facebook.katana", 0);
return new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/" + userId));
} catch (Exception e) {
return new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" + userId));
}
}
谢谢!
【问题讨论】:
标签: java android facebook android-intent package-managers