Both Fragment in ActionBar return true for fragment.isVisible()
问题 In my MainActivity with ActionBar I listen to a listener from a DialogFragment and based on which Fragment of ActionBar i am on, I need to do some things. I am using below code to get the current fragment and check which of the two ActionBar fragment i am on: private Fragment getVisibleFragment() { FragmentManager fragmentManager = getSupportFragmentManager(); List<Fragment> fragments = fragmentManager.getFragments(); if (fragments != null) { for (Fragment fragment : fragments) { if (fragment