Updating Layout When Navigating to Fragment

Nathan Sokalski 4,111 Reputation points
2025-07-13T21:19:48.4566667+00:00

When navigating to a Fragment using the SupportFragmentManager in .NET for Android using code similar to the following:

this.SupportFragmentManager.BeginTransaction().DisallowAddToBackStack().Replace(Resource.Id.fcvMain, new ScoresFragment()).Commit();

Many of the RecyclerView(s) on the Fragment I am navigating to are not displayed. I have confirmed that the LayoutManager(s) & Adapter(s) for the RecyclerView(s) have been set, and that they all have data. I do this in the OnResume method of the AndroidX.Fragment.App.Fragment that contains the RecyclerView(s). I also call the NotifyDataSetChanged() method of the Adapter of each RecyclerView I have also tried creating simple FrameLayout(s) with solid backgrounds & fixed sizes as placeholders, but I could not get them to display either. The root of my Fragment's layout is a 2×5 GridLayout. Why are so many of the child View(s) (including the FrameLayout(s) I mentioned as using for testing) not displayed?

Developer technologies | C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.