The setContentView called in my activity automatically instantiates my fragment that is in the activity layout.
But because the fragment needs an argument passed in that was also passed in the activity intent, I have to instantiate it again with these lines:
val productReviewFragment =
supportFragmentManager .beginTransaction() .replace(R.id.productReviewFragment, productReviewFragment) .commit()
Everything works. I was just curious – is there a way to avoid the double instantiation (which also calls things like onCreate again).