Welcome all

I'm developing an augmented reality app that consists in a camera view with 
some linear layouts on the screen representing the position of a POI in the 
camera.

The LinearLayouts contains some view elements that implements 
onTouchListener and have the action to open a new activity when ACTION_UP 
event is called.

The problem is that ACTION_UP is never called. When i press on one of the 
POIs on the camera screen, the element calls ACTION_DOWN and instantly 
after that, ACTION_CANCEL is being called.

I read that ACTION_CANCEL occurs when the parent takes possession of the 
motion, for example when the user has dragged enough across a list view 
that it will start scrolling instead of letting you press the buttons 
inside of it. You can find out more about it at the viewgroup documentation 
of onInterceptTouchEvent.

The problem is that i dont understand what i'm doing wrong.

This is my code of the ontouch in the element that it is displayed on the 
linearlayout representing a POI on the camera AR View:


public class Element implements OnTouchListener{...
 @Override
    public boolean onTouch(View v, MotionEvent event) {             
        if( event.getAction() == MotionEvent.ACTION_DOWN){
            return true;
        }else if( event.getAction() == MotionEvent.ACTION_UP){ 
            parent.doAction(this.action);
            return true;
        }else if(event.getAction() == MotionEvent.ACTION_MOVE){ 
            return true;
        } else if(event.getAction() == MotionEvent.ACTION_CANCEL){              
    
            return true;                    
        }
        return true;
    }


Thanks

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to