/** * The {@code fragment} is added to the container view with id {@code frameId}. The operation is * performed by the {@code fragmentManager}. */ public static void addFragmentToActivity(@NonNull FragmentManager fragmentManager, @NonNull Fragment fragment, int frameId) { Preconditions.checkNotNull(fragmentManager); Preconditions.checkNotNull(fragment); FragmentTransaction transaction = fragmentManager.beginTransaction(); transaction.add(frameId, fragment); transaction.commit(); } }