Hello.
I'm making a app like bbs.
I use ListView to show Thread. ListView's row has some TextView and
ImageView, and a TextView has some URLSpan.
I want to select a row when I tap the row except link, and when I tap
a link, occur the Click event on URLSpan.
I write below in ListView adapter.
I could select a row, except when I tap the TextView.
> holder.textview2.setFocusable(false);
> holder.textview2.setFocusableInTouchMode(false);
I try to override the row (LinearLayout) 's dispathTouchEvent.
But I cannot.
> @Override
> public boolean dispatchTouchEvent(MotionEvent ev) {
> for(int i = 0; i < getChildCount(); i++) {
> View v = (View) this.getChildAt(i);
> if(v.getTop() < ev.getY()) {
> if(v instanceof TextView) {
> TextView tv = (TextView) v;
> if(tv.getMovementMethod() != null) {
> return
> tv.getMovementMethod().onTouchEvent(tv, (Span> nable) tv.getText(), ev);
> }
>
> }
> }
> }
> return false;
> }
How can I realize I do?
Please help me!
Thanks,
Taro Yoshida
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en