打开Facebook应用程序

时间:2015-05-05 03:04:11

标签: android facebook android-intent

在此示例中,在打开Facebook应用程序后,有没有办法通过使用后退按钮返回我的应用程序中的活动?

PackageInfo info =   context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
if(info.applicationInfo.enabled)
  return new Intent(Intent.ACTION_VIEW,  Uri.parse("fb://profile/620681997952698"));
else
return new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/620681997952698"));

1 个答案:

答案 0 :(得分:0)

请将标记添加到Intent。

intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);

您可以看到此link