title: Calling Method In a fragment from Parent Activity
body: <p>I have five <code>Fragments</code> attached to a <code>ViewPager</code>. I want to validate forms in each before sending the data to my server. So, I decided to loop through the <code>Fragments</code> to see if I can reach the methods. But, I know it can't be reached like that. Below is what I tried</p>
  
  <pre><code> Fragment[] listOfFrags = {new Frag1(), new Frag2(), new Frag3(), new Frag4(),
              new ExpenseFragment()};
      for (int i = 0; i &lt; listOfFrags.length; i++) {
          Fragment cuurentFrag = listOfFrags[i];
          boolean checker = cuurentFrag.ValidateData();&lt;-- The unreachable destination
      }
  </code></pre>
  
  <p>And this is my <code>Adapter</code></p>
  
  <pre><code>    public PagersAdapter(FragmentManager fm) {
      super(fm);
  }
  
  @Override
  public Fragment getItem(int position) {
      Fragment fragment = new Frag1();
      switch (position) {
          case 0:
              fragment = new Frag1();
              break;
          case 1:
              fragment = new Frag2();
              break;
          case 2:
              fragment = new Frag3();
              break;
          case 3:
              fragment = new Frag4();
              break;
          case 4:
              fragment = new Frag5();
      }
      return fragment;
  }
  
  @Override
  public int getCount() {
      return 5;
  }
  </code></pre>