I've got a similar problem, but I did manage to figure this problem
out; you need to return true or it seems to me that the Listener is
cleared from the View and reverts back to its base listener.

On Dec 2, 12:52 pm, Enrique López Mañas <eenriquelo...@gmail.com>
wrote:
> 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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to