相关疑难解决方法(0)

在Android上打开Facebook App中的Facebook页面(如果已安装)

如果Facebook应用程序可用,我想从我的Android应用程序打开我的Facebook页面 - 如果没有:此页面应该在默认浏览器中打开.

为此,我尝试了以下代码:

try {
  Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/MY_PAGE_ID"));
startActivity(intent);
} catch (Exception e) {
   startActivity(new Intent(Intent.ACTION_VIEW,    Uri.parse("http://www.facebook.com/MY_PAGE_NAME")));
}
Run Code Online (Sandbox Code Playgroud)

问题是:我这里有一个Android设备,最新版本的Facebook.如果我想从我的应用程序打开Facebook页面,Facebook应用程序将打开,但没有我的页面.

我只看到消息:

无法加载时间线.

怎么了?

android facebook android-intent

30
推荐指数
4
解决办法
10万
查看次数

标签 统计

android ×1

android-intent ×1

facebook ×1