Facebook应用从我的应用程序通过Intent启动时的空白页面

时间:2016-07-22 06:06:13

标签: android facebook

一旦Facebook应用程序启动,它只显示空白页面。需要刷新页面才能显示配置文件。这是我的代码。

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://facewebmodal/f?href=https://facebook.com/Username")));

2 个答案:

答案 0 :(得分:0)

请尝试使用以下uri

try{ 
    Intent intent = new Intent(Intent.ACTION_VIEW,  Uri.parse("fb://profile/fb_id_of_the_profile"));
    startActivity(intent);
   }catch(Exception e){
     startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/username)));
  }

将“fb_id_of_the_profile”替换为个人资料ID

答案 1 :(得分:0)

我解决了这个问题。我替换了代码

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://facewebmodal/f?href=https://facebook.com/Username")));

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://facewebmodal/f?href=https://www.facebook.com/Username")));

相关问题