I've looked for a while on the internet, but haven't found a solution yet.
So my question is : Is it possible to open a facebook page 'x' in the facebook app, from clicking on a listitem in my own android app?
Because now i'm linking to the fb page 'x' in my app in a webview, and it would be better to open the fb app and directly go to the page 'x'.
EDIT i have found a solution, but it is not working completely yet. it opens the facebook app now, but as the page that I want to display is not a profile but a page it gives an error in the facebook app. here is the code:
public static Intent getOpenFacebookIntent(Context context) {
try {
context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
return new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/androiddevs"));
} catch (Exception e) {
return new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/androiddevs"));
}
}
this does'nt work. if i edit the first URI parse to
Uri.parse("fb://profile/myprofileid")
then I am able to open my profile in the app. but the page I want to display is not my own page. And I could ask them info,if nesecaraly, as I know the people.
but maybe someone has some idea to get this to work.