set Fragment

fun setFragment(    viewRes: Int,     fragment: Fragment,     addToBackStack: Boolean)

Method to attach fragment to layout

Parameters

viewRes

id of Fragment/ FrameLayout

fragment

fragment to attached

addToBackStack

add the fragment to backStack of application

Sources

Link copied to clipboard