Reputation: 6962
I have a project with more than 50 plus layouts, for each one I am doing codes for getting the reference of the widgets like findViewById. Is there anyway to reduce the lines.
Upvotes: 1
Views: 78
Reputation: 9009
Android introduced Data Binding Library
to get rid of findViewById();
visit Android Official : Data Binding Guide.
Important : Its in Beta Version.
Updated: Now its available in Alpha
Upvotes: 3
Reputation: 1035
I would recommend to use Butterknife.
Because it uses annotation processing during compilation, there is no performance/overhead penalty during a runtime.
As a tip, don't forget put ButterKnife.inject(this);
in a proper place like onCreate()
Upvotes: 3