Advertisement

TrimwebsolutionsTrimwebsolutions

Problem and Solutions

cant get any component in fragment class (kotlin) in android studio ?

By M.K. Verma · 4 May 2022

cant get any component in fragment class (kotlin) in android studio ?
override fun onStart() {
    super.onStart()
    htmlViewer = requireView().findViewById(R.id.htmlViewer) as WebView

    htmlViewer!!.loadUrl("https://www.google.com")
}

this is solution.

htmlViewer = requireView().findViewById(R.id.htmlViewer) as WebView

fixed