Question

I have a view animator that has a lot Button on it. I've a OnTouchEvent for the view . codes works fine if I touch on space, but if I touch the button the code doesn't work. how can i fix it?

 final View frame = (View)findViewById(R.id.viewAnimator1);

    frame.setOnTouchListener(new OnSwipeTouchListener() {

         public void onSwipeRight() {   

            viewAnimator.showPrevious();

             }                      
        public void onSwipeLeft() {

             viewAnimator.showNext();
                    }}
Was it helpful?

Solution

You need to set on click listener for buttons, if all of them makes the same work, you can extend button class and implement on click listener and use it instead of normal button

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top