In the function ListView Adapter getView(), I have the following:
holder.comment.setText(Html.fromHtml(comment));
holder.comment.setMovementMethod(LinkMovementMethod.getInstance());
holder.commentis TextView.
In the Activity that this ListView contains, I implemented onItemClick Listener. What worked until I turned on
holder.comment.setMovementMethod(LinkMovementMethod.getInstance());
Now the element’s listening element does not work as if this line of code overrides the behavior of clicks. The click event only works on TextView (holder.comment)that opens a link in the browser. Clicking on any other part of the item ListViewdoes not work.
EDIT:
commentsListView
.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Toast.makeText(CommentsActivity.this,"" + arg2,Toast.LENGTH_LONG).show();
}
});
source
share