I am trying to use ViewSwitcher to act like a image wizard.
I mean there will be next and previous button to change the Image in a ViewSwitcher rather then a gallery. I have taken a reference from API Demo of android sample application.
in that they have used ViewSwitcher and Gallery but i have to use Next and Prev button
instead. But i dont know how to do it.
As in sample application they have used
Gallery g = (Gallery) findViewById(R.id.gallery);
g.setAdapter(new ImageAdapter(this));
g.setOnItemSelectedListener(this);
Where ImageAdapter keeps adding new Images in a ImageView which itself residing in a ViewSwitcher. So how can i do the same with next and previous button ?

If you use an
ImageSwitcherthis is a very simple thing to do. You’ll have to replace theGallerywith your twoButtonsand link them to theImageSwitcher:The two
buttonswill have twoonClickcallbacks:You’ll have to remember to disable the previous
Buttonin theonCreatemethod(as we start with the first image in the array).