Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate class found in the file '/activity_login.xml' DataBinding, BR not being generated

I mostly being stuck with android data binding BR issue. There is single activity.xml always but generated binding class showing error. Please let me know how to resolve this issue.

enter image description here

like image 804
Dipendra Sharma Avatar asked May 26 '18 03:05

Dipendra Sharma


People also ask

What is Br in data binding Android?

Note: The Data Binding Library generates a class named BR in the module package which contains the IDs of the resources used for data binding. In the example above, the library automatically generates the BR. item variable.

Which is the correct way to reference bound data in the XML layout?

Layout Binding expressions Expressions in the XML layout files are assigned to a value of the attribute properties using the “ @{} " syntax. We just need to use the basic syntax @{} in an assignment expression.

What is view binding and data binding?

View Binding is a way of connecting your code to specific views in your layout. This lets you access and modifies the view properties directly from your code. Data Binding, on the other hand, is a way of binding data to your views. This allows you to bind data directly to your views without writing extra code.


1 Answers

Custom binding class name resolved my problem

<data class="ContactItem">     … </data> 
like image 63
xyz Avatar answered Sep 28 '22 05:09

xyz