I’ve fixed it! I called getSupportFragmentManager().executePendingTransactions()
after doing the transaction and it worked! After calling that method I can get the fragment using both findFragmentById()
and findFragmentByTag()
methods.
More Related Contents:
- IllegalStateException: Can not perform this action after onSaveInstanceState with ViewPager
- Google Fused Location API causing error (Android)
- How to determine when Fragment becomes visible in ViewPager
- Dilemma: when to use Fragments vs Activities:
- Refresh Fragment at reload
- Android Fragment onAttach() deprecated
- Android Fragments. Retaining an AsyncTask during screen rotation or configuration change
- Hide/Show bottomNavigationView on Scroll
- Android: can’t replace one fragment with another
- Difference between android.app.Fragment and android.support.v4.app.Fragment
- FragmentContainerView using findNavController
- Show hide fragment in android
- Further understanding setRetainInstance(true)
- How to wrap the height of a ViewPager to the height of its current Fragment?
- Remove old Fragment from fragment manager
- Fragment or Support Fragment?
- Fragment replacing in RecyclerView item
- Why getContext() in fragment sometimes returns null?
- Coordinator Layout with Toolbar in Fragments or Activity
- findFragmentById always returns null
- How to replace the activity’s fragment from the fragment itself?
- isValidFragment Android API 19
- Use external application fragment/activity inside application
- Is there a method that works like start fragment for result?
- Keyboard hides BottomSheetDialogFragment
- Replacing ViewPager with Fragment – Then Navigating Back
- FragmentActivity can not be tested via ActivityInstrumentationTestCase2
- Placing ViewPager as a row in ListView
- Fragment standard transition not animating
- Kotlin: open new Activity inside of a Fragment