android - Layouts used by code generated with Data Binding incorrectly reported as UnusedResource by lint -
lint considering layouts used classes generated data binding unused, therefore triggering corresponding unusedresource warning.
for example:
../../src/main/res/layout/activity_start.xml:2: resource r.layout.activity_start appears unused
despite there's reference in 1 of classes generated data binding:
public static activitystartbinding inflate(android.view.layoutinflater inflater, android.databinding.databindingcomponent bindingcomponent) { return bind(inflater.inflate(com.tuenti.messenger.r.layout.activity_start, null, false), bindingcomponent); }
is there way make lint consider generated classes in order avoid these false positives?
nope cannot force lint consider generated classes.i suggest set them information or ignore instead of warning.
you can set them information or ignore instead of warning (window/preferences/android/lint errorchecking/performance/unusedresources).
Comments
Post a Comment