English 中文(简体)
Anders - Face Intent to visit a certainbook page? [复制]
原标题:Android - Facebook Intent to visit a certain Facebook page? [duplicate]
This question already has answers here:
Closed 10 years ago.

Possible Duplicate:
Open Facebook page from Android app?

是否有信使,其他镜子可以用来打开“Facebook”的镜头并进入一个特定页?

For example, when someone clicks a certain button in my app, I want them to be taken to Facebook to a specific company s public Facebook page. Starting a web browser activity for this is easy, but more than likely the user is not logged in the browser etc...

我认为,如果我可以使用“Intent”(如果存在......的话)来启动“Facebook”的备注,并将用户带入“笔记”。 这样,用户就已经站起来,并且能够同网页一样互动。

Does an Intent like this exist? If so, where would I find more information on it? I ve been looking through Facebook s developer documentation but I m not seeing anything about this.

最佳回答
  1. Go to https://graph.facebook.com/<user_name_here> (https://graph.facebook.com/fsintents for instance)
  2. Copy your id
  3. 使用这种方法:

    public static Intent getOpenFacebookIntent(Context context) {
    
       try {
        context.getPackageManager().getPackageInfo("com.facebook.katana", 0);
        return new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/<id_here>"));
       } catch (Exception e) {
        return new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<user_name_here>"));
       }
    }
    

如果用户安装了“Facebook”仪器,这将打开。 否则,它将在浏览器上打开Facebook。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签