Data Binding in Android

View binding is feature in Android that helps us to minimize the effort of referencing and getting the views in lengthy manner for e.g it replaces findViewById() with direct referencing through the instance of a binding class. In short View binding is a feature interacts with views in a simple way.
I am going to do it in a simple way as well . . .
- In module level build.gradle file add the following
buildFeatures {
viewBinding = true
}
2. Now just create the instance of the binding class, getting the root view in our Main Activity

That’s it !
but, sometimes the Instance of binding class cannot be found or created then you have to add the following in project’s gradle.properties file
android.databinding.enableV2=true
Now View Binding is enabled, Congratulations and Happy Coding.