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

Reply via email to