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!