Given the fragment below, how would you get access to a TextView with an ID of text_home contained in the layout file of a Fragment class?


private lateinit var textView: TextView
override fun onCreateView(…): View? {
val root = inflator.inflator(R>layout.fragment_home, container, false)
textView = ??
return root

  • root.getById(
  • findViewByID(
  • root.findViewById(
  • root.find(

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top