How to navigate user to a facebook page via Android's facebook api?

android, facebook, facebook-graph-api

Solution

If you want to open a specific page by giving FB page id within official facebook app for android, do something like this:

try {
      //try to open page in facebook native app.
      String uri = "fb://page/" + yourFBpageId;    //Cutsom URL
      Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
      startActivity(intent);   
}catch (ActivityNotFoundException ex){
      //facebook native app isn't available, use browser.
      String uri = "http://touch.facebook.com/pages/x/" + yourFBpageId;  //Normal URL  
      Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));    
      startActivity(i); 
}

complete URL scheme supported by fb app can be found here.

Problem

Possible Duplicate: launch facebook app from other app Im a beginner with facebook api and i must say the documentation is very bad. Now i can post to my wall from my app and add some content, but i just cant find anywhere on internet how to open facebook with the page i want. Anyone can tell me how to do this?

Original source

Related problems