Reputation: 107
While using data binding , I have class MainActivityBinding
.
but when i create new Activity(for example SecondActivity), SecondActivityBinding
not generated. I removed
"dataBinding {
enabled = true
}"
from gradle and add it again and make project but SecondActivityBinding
not generated. how I can solve this problem.
Upvotes: 0
Views: 452
Reputation: 1503
The Binding class is generated when you frame your SecondActivity layout.xml file with
<layout> ... </layout>
By default, a Binding class will be generated based on the name of the layout file, converting it to Pascal case and suffixing “Binding” to it. The above layout file was activity_main.xml so the generate class was ActivityMainBinding.
Upvotes: 3