android:how to swipe activities with audio files
<p>Hi guys i need to acheive the following:</p>

<p>i have only 1 class where i have made everything as dynamic so that i can have multiple activities in one file.
When the user enters the app it shows a list where he selects one among them after he selects it goes and displays a image and starts playing a audio file,in the same window i have next and previous buttons.</p>

<p>instead of the next and previous buttons i need to swipe to be implemented how can i acheive that.This is my code for next and previous </p>

<pre><code>if (v == previous) {
            v.startAnimation(AnimationUtils.loadAnimation(this, R.anim.image_click));
            if (i == 0) {
                playoverready.setText(" ");
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.setMessage("No previous points as this is the first point");
                builder.setCancelable(true);
                builder.setPositiveButton("OK",
                        new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int id) {
                                // TODO Auto-generated method stub
                                dialog.cancel();
                            }
                        });
                builder.create().show();
                //previous.setEnabled(false);

            } else {
                handler.removeCallbacks(r);
                handler.removeCallbacks(rprv);
                handler.removeCallbacks(rn);
                handler.removeCallbacks(playisover);
                record.setEnabled(false);
                play.setEnabled(false);
                replay.setEnabled(false);
                display.setText(" ");
                playoverready.setText(" ");
                indicator.setText(" ");
                System.out.println("buttons are disabled...");

                handler.postDelayed(new Runnable() {

                    @Override
                    public void run() {
                        // TODO Auto-generated method stub
                        next.setImageResource(R.drawable.next);
                    }
                },1000);

                i--;

                img.setBackgroundResource(imgNum[i]);

                if (apple.isPlaying()) {
                    apple.stop();
                }
                if (female.isPlaying()) {
                    female.stop();
                    if (mp.isPlaying()) {
                        mp.pause();
                        mp.seekTo(-5);
                    }
                }
                apple = MediaPlayer.create(this, mediaNum[i]);
                handler.postDelayed(new Runnable() {

                    @Override
                    public void run() {
                        // TODO Auto-generated method stub
                        apple.start();
                        record.setEnabled(false);
                        play.setEnabled(false);
                        replay.setEnabled(false);
                    }
                }, 2000);

                rprv = new Runnable() {

                    @Override
                    public void run() {
                        // TODO Auto-generated method stub
                        record.setEnabled(true);
                        play.setEnabled(true);
                        replay.setEnabled(true);
                        indicator.setText("Start Practise");
                        System.out.println("buttons are enabled first...");
                    }
                };
                handler.postDelayed(rprv, (apple.getDuration()) + 2500);

                if (mp.isPlaying()) {
                    mp.pause();
                    mp.seekTo(-5);
                    //mp.stop();
                    /*mp=null;
                    mp.release();*/
                }
                display.setText("");
                if(rec == true){
                    rec = false;
                    record.setImageResource(R.drawable.record);
                    recorder.stop();
                    recorder.release();
                }

            }
        }
case R.id.bnext:
            v.startAnimation(AnimationUtils.loadAnimation(this, R.anim.image_click));
            i++;
            if (i &gt;= noOfQues) {
                playoverready.setText(" ");
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                builder.setMessage("You are already in the last point");
                builder.setCancelable(true);
                builder.setPositiveButton("OK",
                        new DialogInterface.OnClickListener() {

                            @Override
                            public void onClick(DialogInterface dialog, int id) {
                                // TODO Auto-generated method stub
                                dialog.cancel();
                            }
                        });
                builder.create().show();
                //next.setEnabled(false);
                i--;
            } else {
                handler.removeCallbacks(r);
                handler.removeCallbacks(rprv);
                handler.removeCallbacks(rn);
                handler.removeCallbacks(playisover);
                record.setEnabled(false);
                play.setEnabled(false);
                replay.setEnabled(false);
                display.setText(" ");
                playoverready.setText(" ");
                indicator.setText(" ");
                System.out.println("entered buttons are disabled...");


                img.setBackgroundResource(imgNum[i]);

                if (apple.isPlaying()) {
                    apple.stop();
                }
                if (female.isPlaying()) {
                    female.stop();
                    if (mp.isPlaying()) {
                        mp.pause();
                        mp.seekTo(-5);
                    }
                }
                apple = MediaPlayer.create(this, mediaNum[i]);
                handler.postDelayed(new Runnable() {

                    @Override
                    public void run() {
                        // TODO Auto-generated method stub
                        apple.start();
                        record.setEnabled(false);
                        play.setEnabled(false);
                        replay.setEnabled(false);
                    }
                }, 2000);
                rn = new Runnable() {

                    @Override
                    public void run() {
                        // TODO Auto-generated method stub
                        record.setEnabled(true);
                        play.setEnabled(true);
                        replay.setEnabled(true);
                        indicator.setText("Start Practise");
                        System.out.println("buttons are enabled first...");
                    }
                };
                handler.postDelayed(rn, (apple.getDuration()) + 2500);


                previous.setEnabled(true);
                next.setEnabled(true);
                if (mp.isPlaying()) {
                    mp.pause();
                    mp.seekTo(-5);
                    //mp.stop();
                    /*mp=null;
                    mp.release();*/
                }
                display.setText("");
                if(rec == true){
                    rec = false;
                    record.setImageResource(R.drawable.record);
                    recorder.stop();
                    recorder.release();
                }

            }
            break;
</code></pre>

<p>any help would be appreciated thanks in advance</p>
