URL to open facebook app in android

18,014

You need to use Intents. Here's how to call the FB application (if it is installed):

Intent intent = new Intent();
intent.setClassName("com.facebook.katana","com.facebook.katana.ProxyAuth");
intent.putExtra("client_id", applicationId);
mAuthActivityCode = activityCode;
activity.startActivityForResult(intent, activityCode);

This code is taken from the Facebook API, which authorizes an action. Ajust to suit your needs. Code is Copyright 2010 Facebook, Inc., licensed under the Apache License, Version 2.0.

Share:
18,014
mouser58907
Author by

mouser58907

Updated on June 05, 2022

Comments

  • mouser58907
    mouser58907 almost 2 years

    Possible Duplicate:
    Open Facebook page from Android app?

    I have a webview in my android app, and I would like to put a link in that opens the facebook app to my fanpage. In iOS you can say fb://... and it will open the facebook app. Is there a way to do it in android? I'm already overriding shouldOverrideUrlLoading, so I could intercept it and launch an intent if I need to.

  • mouser58907
    mouser58907 almost 13 years
    thanks, I've almost got it working. I'm not sure what the activity codes are though. and for application ID is that my fan page id? I can't seem to find very good documentation on this.
  • Amandeep Grewal
    Amandeep Grewal almost 13 years
    Try the code presented here: stackoverflow.com/questions/4810803/…