Viewflipper not flipping
<p><b>I am creating a Viewflipper. However when i run and try to move my hand on the screen, nothing happens. What am i Missing out?
Thanks</p>

<p>Here is the java code.</p>

<p></b></p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gallery);

    flipper = (ViewFlipper)findViewById(R.id.flipperGallery);
    flipper.setOnTouchListener((android.view.View.OnTouchListener) this);
}

@Override
public boolean onTouchEvent(MotionEvent touchevent) {
switch (touchevent.getAction())
{
    case MotionEvent.ACTION_DOWN:
    {
    lastX = touchevent.getX();
    Toast.makeText(this, "X: " + lastX, Toast.LENGTH_LONG).show();

    break;
    }
case MotionEvent.ACTION_UP:
    {
    float currentX = touchevent.getX();
    if (lastX &lt; currentX){
        Toast.makeText(this, "scroll right: ", Toast.LENGTH_LONG).show();

        if (flipper.getDisplayedChild()==0) break;
        flipper.setInAnimation(this, R.anim.in_from_left);
        flipper.setOutAnimation(this, R.anim.out_to_right);
        flipper.showNext();
        }
    if (lastX &gt; currentX){
        Toast.makeText(this, "scroll left: ", Toast.LENGTH_LONG).show();

        if (flipper.getDisplayedChild()==1) break;
        flipper.setInAnimation(this, R.anim.in_from_right);
        flipper.setOutAnimation(R.anim.out_to_left);
        flipper.showPrevious();
        }
    break;
    }
}
return false;
}
</code></pre>

<p>I am creating a Viewflipper. However when i run and try to move my hand on the screen, nothing happens. What am i Missing out?
Thanks</p>
