0

How Do I view a certain view from another class. Example:

I've got 2 .java classes both are viewflipper and have 10 views.

If I was on the first 1.java class and and wanted to go to a certain view like view number 8 in the 2.java class is it possible? I've got this code:

            VF.setDisplayedChild(8);

But this code only goes if your already inside the class.. What if I'm outside of the box :(

Thanks

Wahid

Wally
  • 47
  • 1
  • 6

1 Answers1

0

First, make sure you initialized both your classes or you'll throw an NPE.

Then, if you're in the first flipper, you'll need to set the content view to the second flipper, and then once you've done that you can call VF.setDisplayedChild(x); (or even call it before, then switch views).

If your content view is still the first one, flipping the second one will only flip it, but not actually display it.

Perception
  • 79,279
  • 19
  • 185
  • 195
Cruceo
  • 6,763
  • 2
  • 31
  • 52