2

I know is a well-known topic, but none of the solutions worked for me. I'm using this code to launch facebook app at a specific profile page from my app:

try {
    Intent fb_intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/" + id_facebook));
    fb_intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
    startActivity(fb_intent);
} catch (Exception e) {
    Intent fb_intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" + id_facebook));
    fb_intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
    startActivity(fb_intent);
}

Facebook App opens correctly but shows an infinite loop with no data at all on the requested profile page.

Any idea why? Thank a lot in advance

ArthurEld
  • 33
  • 7

1 Answers1

0

I try to figure out with similar trouble..

    public static Intent newFacebookIntent(PackageManager pm, String userId) {
       Uri uri;
       try {
           pm.getPackageInfo("com.facebook.katana", 0);
           uri = Uri.parse("fb://facewebmodal/f?href=" + userId);
       } catch (PackageManager.NameNotFoundException e) {
           uri = Uri.parse(userId);
       }
       return new Intent(Intent.ACTION_VIEW, uri);
    }

For it's work fine

https://stackoverflow.com/a/24547478/3864698

Community
  • 1
  • 1
DMan
  • 258
  • 3
  • 22
  • Thanks, it's not really a clean solution, it opens the right page but sends back on an error page after pushing "back" – ArthurEld Oct 10 '15 at 21:36