How do I programmatically add an Android Gestures view to a custom view?
Posted
by user351201
on Stack Overflow
See other posts from Stack Overflow
or by user351201
Published on 2010-05-26T17:29:58Z
Indexed on
2010/05/26
17:31 UTC
Read the original article
Hit count: 240
I have a custom view that works fine and I'm trying to get gestures into it. The most common technique I see is to add XML, such as this (from Android docs:
My view is within a RelativeView and when I attempt to reference this GetureOverlayView, I get an exception.
I've also tried to connect within my existing custom view class, like this: mGestures = new GestureOverlayView(context, attrs); mGestures.addOnGesturePerformedListener(this);
But the callback is never invoked.
Can someone see my errors or suggest a better way that will allow me to get gesture callbacks?
© Stack Overflow or respective owner