title: Swipe on ViewFlipper
body: <p>I have a ViewFlipper and in it, four scrollviews with layouts in those.</p>
  
  <p>I use the following code (for each scrollview) to swipe:</p>
  
  <pre><code>ScrollView View1 = (ScrollView) findViewById(R.id.View1);
      View1.setOnTouchListener(new OnTouchListener() {
  
          public boolean onTouch(View v, MotionEvent event) {
              // TODO Auto-generated method stub
  
              if (event.getAction() == MotionEvent.ACTION_DOWN) {
                  FirstX = (int) event.getX();
              }
  
              if (event.getAction() == MotionEvent.ACTION_MOVE) {
                  int LastX = (int) event.getX();
  
                  if (FirstX - LastX &gt; SWIPE_MIN_DISTANCE) {
                      viewFlipper.setInAnimation(slideLeftIn);
                      viewFlipper.setOutAnimation(slideLeftOut);
                      viewFlipper.showNext();
                  } else if (LastX - FirstX &gt; SWIPE_MIN_DISTANCE) {
                      viewFlipper.setInAnimation(slideRightIn);
                      viewFlipper.setOutAnimation(slideRightOut);
                      viewFlipper.showPrevious();
                  }
              }
  
              return true;
          }
      });
  </code></pre>
  
  <p>It works, but it looks like if I swipe from View 1 to View 2, I see a views 2 and 3 mixed together and it finally shows view 4.</p>
  
  <p>So it seems the OnTouchListeners for each view are called after eachother.
  How can I prevent this from happening?</p>
  
  <p>A short and fast swipe does what it is supposed to do.</p>
  
  <p>rg,
  Eric</p>