I am working on integrating Twitter in an app and while all works as it should I am stumped on the setOnItemClickListener()
not triggering when a ListView
item
has a link in it. It works just fine when an item
does not have a link (URL) in it.
Clicking on the URL itself opens the web page in a Browser.
Please see the screenshots added as reference at the end of the post.
It is a custom ListView
that employs a BaseAdapter
. I am not sure which piece of code to put in but on being pointed to a code block that the folks here may need, I will add it immediately.
The idea behind needing to ignore the links (URLs) in an item is to provide a functionality that shows the tweet details when a user clicks on one. Something similar to what the Twitter Android app does.
So what do I do to make the setOnItemClickListener()
ignore the links in items?
UPDATED:
Okay. SO I am not sure if it is relevant to the question, but, from a combination of a few solutions from SO which led me to the TweetLanes Open Source project, I have managed to get a few things working. But unfortunately, it doesn't address my primary question.
How do I make the setOnItemClickListener()
ignore the links in an item so I can click it and show the details in another Activity and yet, when I click on a link, not trigger the setOnItemClickListener()
? I keep getting partial solutions in every attempt I make. But at times, when I click on a link
, the setOnItemClickListener()
triggers too.
This is how it the flow looks at the moment:
In the top two screenshots, it works as it should. Not clicking on a link after all.
In the bottom two, however, when I click on the @ibnlive link, it shows the Profile for the user (@ibnlive). This part is derived from the TweetLanes source. The problem is, the click listener is also triggered. This is one of the solutions I am trying out. In this case, I have commented out the setOnItemClickListener()
and am using a OnClickListener()
on the TextView
. This is the one method which has partial success so far.