LongClick textView, clickable link
<p>I am writing an app that has a ListView of text. In each row there is a combination of text and links. I added an OnItemLongClickListener to the list and made the links clickable with </p>

<pre><code>my_text.setMovementMethod(LinkMovementMethod.getInstance());
</code></pre>

<p>The problem is, if I am able to click the link, I cannot get the textView to register the LongClick. </p>

<p>I have tried different methods to make the links clickable such as</p>

<pre><code>android:autoLink="web
</code></pre>

<p>But this doesn't make the links clickable. </p>

<p>My question is: Is there a different way that I should set the LongClickListener, or a different way to make the links clickable? </p>

<p>Has anyone else encountered a similar problem?</p>

<p>I should note that right now the OnItemLongClickListener makes the links register the LongClicks but this causes a problem when a textview doesnt have a link or a user tries to longClick somewhere else in the view (besides the link)</p>

<p>Code:
I programatically inflate a relativeLayout containing a list view and add it to a view flipper:</p>

<p>RelativeLayout:</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"&gt;

    &lt;ListView
        android:id="@+id/my_list"
        style="@style/listViewSimple"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#f9f9f9"
        android:cacheColorHint="#00000000"
        android:divider="#ccc"
        android:dividerHeight="1px"
        android:fadingEdge="none"
        android:fadingEdgeLength="30dp"
        android:footerDividersEnabled="false"
        android:headerDividersEnabled="false"
        android:persistentDrawingCache="none" &gt;
    &lt;/ListView&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>Adding everything programatically: </p>

<pre><code>            RelativeLayout list = (RelativeLayout) LayoutInflater.from(MyActivity.this).inflate(R.layout.my_list_layout, null);
            vf.addView(list);
            ListView lv = (ListView) list.findViewById(R.id.my_list);
            lv.setOnItemLongClickListener(listLongListener);
</code></pre>

<p>Making Links clickable(in getView() of adapte):</p>

<pre><code>        my_tv.setText(Html.fromHtml(formatted_text)));
        my_tv.setLinkTextColor(linkColor);
        my_tv.setMovementMethod(LinkMovementMethod.getInstance());
</code></pre>

<p>This makes links clickable but seems consume all clicks before they get to the textview. I tried to add a longClickListener that returns false but that didn't seem to have any affect. </p>

<p>My temporary fix is to set a itemLongClickListener and an onItemClickListener to the listItem and just display a dialog with the clickable text in onListItemClick. This works but adds an extra click for users to interact with the text</p>
