Opening the facebook app through a textview?

时间:2015-07-08 15:50:31

标签: android

By clicking on the URL that is in TextView, I would direct redirect to the Facebook application.

The following is a code excerpt that I have to leave the textview clicked

// Checking for null feed url
    if (item.getUrl() != null) {
        url.setText(Html.fromHtml("<a href=\"" + item.getUrl() + "\">"
                + item.getUrl() + "</a> "));

        // Making url clickable
        url.setMovementMethod(LinkMovementMethod.getInstance());
        url.setVisibility(View.VISIBLE);

Example Image

http://i.stack.imgur.com/Ipy3D.png

When you click the TextView it opens the app chooser dialog to complete the action. I would like it to directly open Facebook

1 个答案:

答案 0 :(得分:1)

您编写应用程序的方式 不可能

通过HREF深度链接尚无法使用应用选择器。

这是计划在Android M中发布的功能。

<intent-filter android:label="@string/filter_name" android:autoVerify="true">
   //...categories etc
</intent-filter>

更多信息here

BUT

您仍然可以直接在您的应用和Facebook应用之间进行深层链接。你可以用多种方式做到这一点。

Facebook API有关于此

的大量文档

https://developers.facebook.com/docs/sharing/android