You should return true in the ACTION_DOWN case, then you'll see the
other events.

2009/12/2 Enrique López Mañas <[email protected]>:
> Hello all,
>
> I'm trying to develop a touch control, but I'm getting some problems
> with the onTouch method. Basically, only the event ACTION_DOWN is
> working. The others seems to be in trouble. My application has a
> LinearLayout, containing a VideoView.
>
> I have a HTC Magic updated to 1.6. With a basic code like this one:
>
> public boolean onTouch(View v, MotionEvent event) {
>                // TODO Auto-generated method stub
>                  int action = event.getAction();
>                    switch (action) {
>                      case MotionEvent.ACTION_DOWN:
>                        return false;
>                      case MotionEvent.ACTION_MOVE:
>                        return true;
>                      case MotionEvent.ACTION_UP:
>                          return true;
>                      case MotionEvent.ACTION_CANCEL:
>                          return false;
>                      case MotionEvent.ACTION_OUTSIDE:
>                          return false;
>                      default:
>                    }
>                return false;
>        }
>
> I always enter into the first case. I've been googling and trying to
> find a response for it.  I added the following permision lines to the
> manifest.
>
>        <uses-permission
> android:name="android.permission.ACCESS_SURFACE_FLINGER" />
>        <uses-permission android:name="android.permission.BIND_INPUT_METHOD" /
>>
>        <uses-permission android:name="android.permission.HARDWARE_TEST" />
>
> Hope someone can give some useful hints. Thank you in advance, and
> regards,
>
> Enrique
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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

Reply via email to