So, I have two views, a background that covers the screen, and an EditText that I reposition over the screen at various times. They both implement dispatchTouchEvent (as well as zillions of gesture detection methods), but I really only want to operate on one or the other in any given instance. Taps on the background should be processed by the background view and taps on the EditText (my derived subclass) should be processed by that view. I already tried storing the event reference itself and in each dispatchTouchEvent() call, first asking the other view if it already processed that view, but the reference does not change from one action to another -- it's always the same event, so I have resorted to saving the event's eventTime, and that seems to work, but it feels like hack, meaning, I would imagine there is a more direct way to accomplish my goal.
Do you think I'm on the right track or would your recommend a different approach? On Apr 18, 7:48 pm, Dianne Hackborn <hack...@android.com> wrote: > It isn't know at that time; it won't be determined until you call the > superclass to ViewGroup.dispatchTouchEvent, which determines the child view > and adjusts the motion event to dispatch to the child. > > On Mon, Apr 18, 2011 at 7:07 PM, Keith Wiley <kbwi...@gmail.com> wrote: > > Given the MotionEvent received dispatchTouchEvent(), is there anyway > > to determine at that time which view received (or is about to receive) > > the event, assuming it is a down event I suppose? > > > -- > > 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+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Dianne Hackborn > Android framework engineer > hack...@android.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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en