I would like to implement a Single-Activity Multi-Fragments design in my app. I plan to have several \"screens\" (layouts of Fragment) that I\'ll switch between (possibly adding
this.loadFragment(AlarmExample.newInstance())
this.loadFragment(XmlParsingFragment.newInstance())
private fun loadFragment(fragment: Fragment) {
supportFragmentManager.beginTransaction()
.replace(R.id.fragmentContainer, fragment)
.commit()
}
In this way, you can set any fragment, based upon your requirement.