How can i toast some msg when Viewflipper image is clicked?
<p>I implement viewflipper code that can show some image from drawable folder and previous and next image without using button..here is my code:</p>

<pre><code>    public class Flower extends Activity implements OnClickListener  {

        int gallery_grid_Images[]={R.drawable.fl1,R.drawable.fl2,R.drawable.fl3 };

        ViewFlipper vf;
        Button back,info;

         private float oldTouchValue;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            setContentView(R.layout.flower);



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


            for(int i=0;i&lt;gallery_grid_Images.length;i++)
            {
                setFlipperImage(gallery_grid_Images[i]);
            }

            back=(Button)findViewById(R.id.bback);
            info=(Button)findViewById(R.id.btinfo);

            back.setOnClickListener(this);
            info.setOnClickListener(this);


        }


        private void setFlipperImage(int res) {
            Log.i("Set Filpper Called", res+"");
            ImageView image = new ImageView(getApplicationContext());
            image.setBackgroundResource(res);
            vf.addView(image);
        }


        @Override
            public boolean onTouchEvent(MotionEvent touchevent) {
                switch (touchevent.getAction())
                {
                    case MotionEvent.ACTION_DOWN:
                    {
                        oldTouchValue = touchevent.getX();
                        break;
                    }
                    case MotionEvent.ACTION_UP:
                    {
                        //if(this.searchOk==false) return false;
                        float currentX = touchevent.getX();
                        if (oldTouchValue &lt; currentX)
                        {
                           vf.setInAnimation(inFromLeftAnimation());
                           vf.setOutAnimation(outToRightAnimation());
                            vf.showNext();
                        }
                        if (oldTouchValue &gt; currentX)
                        {
                            vf.setInAnimation(inFromRightAnimation());
                            vf.setOutAnimation(outToLeftAnimation());
                            vf.showPrevious();
                        }
                    break;
                    }
                }
                return false;
            }

            //for the previous movement
            public static Animation inFromRightAnimation() {

                Animation inFromRight = new TranslateAnimation(
                Animation.RELATIVE_TO_PARENT,  +1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,
                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
                );
                inFromRight.setDuration(350);
                inFromRight.setInterpolator(new AccelerateInterpolator());
                return inFromRight;
                }
            public static Animation outToLeftAnimation() {
                Animation outtoLeft = new TranslateAnimation(
                 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  -1.0f,
                 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
                );
                outtoLeft.setDuration(350);
                outtoLeft.setInterpolator(new AccelerateInterpolator());
                return outtoLeft;
                }    
            // for the next movement
            public static Animation inFromLeftAnimation() {
                Animation inFromLeft = new TranslateAnimation(
                Animation.RELATIVE_TO_PARENT,  -1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,
                Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
                );
                inFromLeft.setDuration(350);
                inFromLeft.setInterpolator(new AccelerateInterpolator());
                return inFromLeft;
                }
            public static Animation outToRightAnimation() {
                Animation outtoRight = new TranslateAnimation(
                 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  +1.0f,
                 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
                );
                outtoRight.setDuration(350);
                outtoRight.setInterpolator(new AccelerateInterpolator());
                return outtoRight;
                }


            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
    switch(v.getId()){


                case R.id.bback:

                    Intent back= new Intent(Flower.this,Main.class);
                    back.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                    startActivity(back);

                break;

                case R.id.btinfo:
                    break;
            }



            }
</code></pre>

<p>Now in btinfo button i want to implement that when the currentview of image is click then toast some info of that image.How can i implement this dynamically? </p>
