Friday, November 30, 2012

Re: [android-developers] Re: View Group onclick event not firing

Hi All,

Parent layout holds the ontouch event so it didnt allow click events to its child. Do we have any work around to make touch event for parent to drag the layout and click event to child items.

Thanks

On Wednesday, November 7, 2012 10:54:28 PM UTC+5:30, Mobile Developer wrote:
Hi All,

Click event in vewgroup child not firing if i use dispatchTouchEvent(MotionEvent e) for touch. if i  use onInterceptTouchEvent(MotionEvent e) i can stop the touch event and click is working as we expect. but i need click for viewgroup child items also i need to touch to drag the viewgroup.


Thanks in advance


On Wednesday, November 7, 2012 1:25:01 PM UTC+5:30, Mobile Developer wrote:
Hi Bob

Thanks for your reply. I need to use both touch and click events. if i return false from dispatchTouchEvent then i cant able to use touch events.
I dont know how to add click events for viewgroup childs.


Thanks


On Wed, Nov 7, 2012 at 1:03 AM, bob <bob@coolfone.comze.com> wrote:
Why don't you return false in dispatchTouchEvent?


On Tuesday, November 6, 2012 6:37:47 AM UTC-6, Mobile Developer wrote:
Hi All,

I have viewgroup that extends LinearLayout but i cant able to add onclick events to the child elements. Its only accessing ontouch event.

I used dispatchTouchEvent(MotionEvent e) to touch event and i returned true.

I tried onInterceptTouchEvent(MotionEvent ev) to stop touch event. eventhough i cant able to add onclick event.


How to add click event on ViewGroup child elements. can we able add onclick and ontouch event for viewgroup?


Thanks in advance

android-developers@googlegroups.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment