0

I have a CardView with a TextView inside it:

<?xml version="1.0" encoding="utf-8"?>

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/card_view_summary"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="3dip"
    android:animateLayoutChanges="true"
    android:translationZ="0dp"
    card_view:cardCornerRadius="0dp"
    card_view:cardElevation="0dp">

        <TextView
            android:id="@+id/comment"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:linksClickable="true"
            android:text="Medium Text"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="12sp"
            android:textStyle="normal" />

</android.support.v7.widget.CardView>

Inside the TextView There are HTML links, and therefore assign a LinkMovementMethod to it.

viewHolder.comment.setMovementMethod(LinkMovementMethod.getInstance());

When I long click on the CardView, I want it to bring up a Contextual Action Bar. This works fine if I long click anywhere in the CardView that isn't overlapped by the TextView. But If I long click on the TextView (not a link) it does not detect the long click.

Is there anyway for just the links to be clickable, but the rest of the TextView not just disregard it and use the card views on click instead?

Thanks!

Jas
  • 3,207
  • 2
  • 15
  • 45
Tmarsh2
  • 417
  • 2
  • 16
  • Take a look here, it may help: http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable – SimoV8 Jan 15 '16 at 09:47
  • Sorry I may have explained this badly, but basically, I only want the HTML links to "Consume" the click, not the entire textview as it does now using LinkMovementMethod.getInstance() – Tmarsh2 Jan 15 '16 at 09:57

0 Answers0