Just a thought. What happens if you comment out base.OnTouchEvent(e);
and then add return true; in the bottom? My theory that the event gets
eaten by the base implementation.

On Thu, Jun 21, 2012 at 11:12 AM, Hänke, Maik <hae...@initions.com> wrote:
> Hi,
>
>
>
> I try to get touch events in my view but only the MotionEventActions.Down
> appears. There are no Up and Down events.
>
>
>
> I tried override OnTouchEvent in my activity and it works. What is wrong in
> my view?
>
>
>
> public class TestView : View
>
> {
>
>        public TestView(Context c)
>
>              : base(c)
>
>        {
>
>        }
>
>
>
>        public override bool OnTouchEvent(MotionEvent e)
>
>        {
>
>               base.OnTouchEvent(e);
>
>
>
>               switch (e.Action)
>
>               {
>
>                      case MotionEventActions.Down:
>
>                            Log.Debug("Test", "DOWN");
>
>                            break;
>
>                      case MotionEventActions.Up:
>
>                            Log.Debug("Test", "UP");
>
>                            break;
>
>                      case MotionEventActions.Move:
>
>                            Log.Debug("Test", "MOVE");
>
>                            break;
>
>               }
>
>        }
>
> }
>
>
>
> [Activity(Label = "TouchTest", MainLauncher = true)]
>
> public class Activity1 : Activity
>
> {
>
>        protected override void OnCreate(Bundle bundle)
>
>        {
>
>              base.OnCreate(bundle);
>
>
>
>              SetContentView(new TestView(this));
>
>        }
>
> }
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>



-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to