here is my code for swiping of images (right,left,top,bottom) and now i want to display those images randomly..please help me as i was new to android
<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
</code></pre>

<p>

<pre><code>android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

&gt;

&lt;TableLayout android:id="@+id/LinearLayout01" 

    android:layout_width="fill_parent" 

    android:layout_height="wrap_content"&gt;

    &lt;TableRow&gt;

        &lt;TextView android:id="@+id/btnback"

            android:text="Fling left - Back  "

            android:layout_width="fill_parent"

            android:layout_height="wrap_content" /&gt;


        &lt;TextView android:id="@+id/btnforward"

            android:text="  Fling right - Forward"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content" /&gt;

    &lt;/TableRow&gt;

&lt;/TableLayout&gt;

&lt;ViewFlipper

    android:id="@+id/pages"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent" &gt;

    &lt;TextView


        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:background="@drawable/namitha_1" /&gt;

    &lt;TextView


        android:layout_width="fill_parent"

        android:layout_height="fill_parent" 

        android:background="@drawable/namitha_2" /&gt;

    &lt;TextView



        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:background="@drawable/namitha_3"  /&gt;

    &lt;TextView


        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:background="@drawable/namitha_5"  /&gt;

    &lt;TextView


        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:background="@drawable/namitha_6"  /&gt;

    &lt;TextView


        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:background="@drawable/namitha_7"  /&gt;



&lt;/ViewFlipper&gt;
</code></pre>

<p></p>

<pre><code>    public class FlipperFling extends Activity implements OnGestureListener {

protected GestureDetector gestureScanner;

protected ViewFlipper vf;

private static final int SWIPE_MIN_DISTANCE = 120 ;

private static final int SWIPE_MAX_OFF_PATH = 250;

private static final int SWIPE_THRESHOLD_VELOCITY = 300;

@Override

public void onCreate(Bundle savedInstanceState){

    super.onCreate(savedInstanceState);

    gestureScanner = new GestureDetector(this);

    setContentView(R.layout.main);

    vf = (ViewFlipper) findViewById(R.id.pages);

}

@Override

public boolean onTouchEvent(MotionEvent me){

    return gestureScanner.onTouchEvent(me);

}

public boolean onDown(MotionEvent e){

    return true;

}

public boolean onFling(MotionEvent e1,MotionEvent e2,float velocityX,float velocityY){

    try {

        if(e1.getX() &gt; e2.getX() &amp;&amp; Math.abs(e1.getX() - e2.getX()) &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {

            Toast.makeText(this.getApplicationContext(), "Left", Toast.LENGTH_SHORT).show();

            vf.showPrevious();

        }else if (e1.getX() &lt; e2.getX() &amp;&amp; e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {

            Toast.makeText(this.getApplicationContext(), "Right", Toast.LENGTH_SHORT).show();

            vf.showNext();

        }

        if(e1.getY() &lt; e2.getY() &amp;&amp; e2.getY() - e1.getY() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityY) &gt; SWIPE_THRESHOLD_VELOCITY) {

            Toast.makeText(this.getApplicationContext(), "Top", Toast.LENGTH_SHORT).show();

            vf.showPrevious();

        }

        else if(e2.getY() &lt; e1.getY() &amp;&amp; e1.getY() - e2.getY() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityY) &gt; SWIPE_THRESHOLD_VELOCITY) {

            Toast.makeText(this.getApplicationContext(), "Bottom", Toast.LENGTH_SHORT).show();

            vf.showNext();
       } 
    }



       catch (Exception e) {

        // nothing

    }

    return true;



}

public void onLongPress(MotionEvent e){}



public boolean onScroll(MotionEvent e1,MotionEvent e2,float distanceX,float distanceY){

    return true;

}

public void onShowPress(MotionEvent e){}

public boolean onSingleTapUp(MotionEvent e){ return true;}
</code></pre>

<p>}</p>
