Is it possible to pass custom attributes through the ViewStub to the root element of the target layout? For instance:
<ViewStub
android:layout="@layout/custom_view"
app:customAttr="12345"
/>
Where custom_view.xml:
<blah.CustomView ...>
...
</blah.CustomView>
When I try to do this, CustomView.java does not get "app: customAttr" in the AttributeSet.
When I use CustomView directly, without ViewStub
<blah.Custom app:customAttr="12345"/>
The attribute falls into the AttributeSet normally.
But he is no longer lazy.
Any solutions?
Thank you, Yuri.
source
share