【发布时间】:2014-08-22 23:51:46
【问题描述】:
我曾经使用以下代码从我的应用程序打开我的 facebook 页面,但从 2014 年 6 月 21 日发布的 facebook v11.0.0.11.23 开始,这不再起作用,知道如何在新的 facebook 应用程序中打开页面? 需要注意的是,它现在打开了 facebook 应用程序,但没有打开指定的页面,它在最新更新之前可以正常工作
public void openFacebookPage() {
Intent intent = null;
try {
context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<id here>"));
//tried this also
//intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/<id here>"));
} catch (Exception e) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<name here>"));
}
context.startActivity(intent);
}
【问题讨论】: