1

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

https://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

cjds
  • 8,268
  • 10
  • 49
  • 84
William
  • 294
  • 3
  • 16
  • What do you want to do? Open facebook normaly or open a concrete thing of facebook like post a message or a concrete post etc.. Is important to answer you – Aracem Jul 08 '15 at 16:02
  • I like it when the User click the textview open facebook and not the choice window. – William Jul 08 '15 at 16:05
  • @William you are going against the preferred Android user experience. Android users expect the flexibility that you are trying to take away. Also - what if the Facebook app is not installed? Does the TextView click do nothing? – Phil Jul 08 '15 at 16:09
  • possible duplicate of [handle textview link click in my android app](http://stackoverflow.com/questions/1697084/handle-textview-link-click-in-my-android-app) – njzk2 Jul 08 '15 at 16:14
  • @Phil You're right, but could put any condition to make click only if you have installed the Facebook app. – William Jul 08 '15 at 16:24
  • There is no way I can draw a direct link to the facebook app? – William Jul 08 '15 at 16:25

1 Answers1

1

The way you have written your application this is not possible

Deep Linking through HREF is not yet able to not use the App chooser.

This is a feature scheduled for release in Android M.

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

More info here


BUT

You can still deep link directly between your app and the Facebook app. You can do it in multiple ways.

The Facebook API has extensive documentation on this

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

Community
  • 1
  • 1
cjds
  • 8,268
  • 10
  • 49
  • 84