I have an activity that use ViewPagerIndicator.
I have implement a class PagerAdapter that extends FragmentPagerAdapter, to set the fragment on the page.
In my activity this is my code:
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mAdapter = new PagerAdapter(getSupportFragmentManager());
    mPager = (ViewPager)findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
    mIndicator.setViewPager(mPager);
}
My activity also have a menu options, with a  option "A" . When user click on option menu and choose "A", my activity want to call a method of the current fragment. But how activity know the currentFragment?
I want this:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.A:
            getCurrentFragment.Method(); //Method is the method that want to execute
        // ...
    }
}
 
     
     
     
    