Ah replacing the content view with the fragment works. You just have to know that it has the id android.R.id.content 🧐
I like the new way with #Jetpack a lot, look https://developer.android.com/guide/navigation/navigation-getting-started
The activity has almost no things to do.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!