Binding has changed its methods?

  • Thread starter Thread starter Android Central Question
  • Start date Start date
A

Android Central Question

I've updated my build.gradle (Module: app) with a newer implementation of 'kotlin-kapt' and implemented the navigation plugin.

Android Studio has now highlighted these lines as errors inside the onCreateView function of my Fragments:

private lateinit var binding: FragmentPrincipalBinding

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_principal, container, false)
[...]
-> binding.setLifecycleOwner(this) <-
[...]
-> return binding.root() <-
}

The methods are now not avaiable for the binding object so, how do I do the Lifecycle owning of the binding for the Fragment? And what do I return now?
 
I moved this to the Software Development forum for more specific traffic.
 
I've updated my build.gradle (Module: app) with a newer implementation of 'kotlin-kapt' and implemented the navigation plugin.

Android Studio has now highlighted these lines as errors inside the onCreateView function of my Fragments:

private lateinit var binding: FragmentPrincipalBinding

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_principal, container, false)
[...]
-> binding.setLifecycleOwner(this) <-
[...]
-> return binding.root() <-
}

The methods are now not avaiable for the binding object so, how do I do the Lifecycle owning of the binding for the Fragment? And what do I return now?
If you can register a account here, so you can communicate . I'll leave a link to register
https://forums.androidcentral.com/ask-question/409154-join-android-central-community.html
 

Latest posts

Trending Posts

Forum statistics

Threads
956,265
Messages
6,967,277
Members
3,163,498
Latest member
BLIND AL SO-CAL