如何通过Android的Facebook的API导航用户在Facebook页面? [英] How to navigate user to a facebook page via Android's facebook api?
本文介绍了如何通过Android的Facebook的API导航用户在Facebook页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
从其他应用 推出的Facebook应用程序
Possible Duplicate:
launch facebook app from other app
IM与Facebook API初学者,我必须说的文档是非常糟糕的。
现在,我可以从我的应用程序发布到我的墙上,并添加一些内容,但我就是不能找到任何地方的互联网如何打开与我想要的Facebook页面上。
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?
推荐答案
如果您希望通过提供针对Android官方的Facebook应用程序中的FB编号打开一个特定的页面,做这样的事情:
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);
}
由FB应用支持完整的URL方案可以在这里找到
这篇关于如何通过Android的Facebook的API导航用户在Facebook页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文