views:

574

answers:

3

I have an application using ListView inside Tabs, and i'd like to switch to a separate View(data collection widget) on clicking an item in the List. I'm adding each List's row's children to a ViewFlipper and the items are added at runtime so there is no definite number of views. As such, i would want to navigate/switch to a particular View in the ViewFlipper. Any pointers? Thanks in advance.

+1  A: 

there is no definite number of views.

Very bad approach to add infinite views for a ViewFlipper. Try to add only one, and when an list item is selected refresh the only view and bring it up.

Pentium10
A: 

I have the same problem, I think we had to put in the viewflipper the current view, and the next view we want to display, and call the method shownext() (or showprevious()).

Anthony M.
Thank you Muniu, it's works fine for the flip! But with your solution, the view flipper is no longer center is his parent even if I define it in the xml layout...Is someone have an idea?
Anthony M.
A: 

Thanks guys. I have worked around the ViewFlipper setDisplayedChild() method and it works perfectly in my scenario.

myViews.setDisplayedChild(pos);

pos being the ID of the View I want to switch to.

Muniu