You should be able to do the following:
MyFragmentClass test = (MyFragmentClass) getSupportFragmentManager().findFragmentByTag("testID");
if (test != null && test.isVisible()) {
//DO STUFF
}
else {
//Whatever
}
More Related Contents:
- Send data from activity to fragment in Android
- Best practice for instantiating a new Android Fragment
- ViewPager and fragments — what’s the right way to store fragment’s state?
- How to resume existing Fragment from BackStack
- Dynamically changing the fragments inside a fragment tab host?
- getView returning null when fragment has been created from an activity
- Show DialogFragment with animation growing from a point
- How can I access getSupportFragmentManager() in a fragment?
- Fragment in ViewPager using FragmentPagerAdapter is blank the second time it is viewed
- Wrong requestCode in onActivityResult
- One Activity and all other Fragments [closed]
- Android Fragments: When to use hide/show or add/remove/replace?
- fitsSystemWindows effect gone for fragments added via FragmentTransaction
- Android replace the current fragment with another fragment
- Android – getTargetFragment and setTargetFragment – What are they used for
- ViewPager + RecyclerView issue in android
- How to use data-binding with Fragment
- application content goes behind the navigation bar in android L
- Fragment must be a public static class to be properly recreated from instance state
- android:configChanges=”orientation” does not work with fragments
- Google Maps Fragment returning null inside a fragment
- Why use Fragments? [duplicate]
- Trying to remove fragment from view gives me NullPointerException on mNextAnim
- How to pass result from second fragment to first fragment
- Is there a method that works like start fragment for result?
- Keyboard hides BottomSheetDialogFragment
- Replacing ViewPager with Fragment – Then Navigating Back
- Placing ViewPager as a row in ListView
- Fragment standard transition not animating
- Kotlin: open new Activity inside of a Fragment