I have lots of control repeated in my xml (a Button for instance). Is there any possibility to write the Button once in a xml and then import it in all the layout I need it?
xml
Button
You can use
<include layout="@layout/commonlayout" android:id="@+id/id" />
commonlayout.xml should be defined in res/layout where you can add the repeated parts.
commonlayout.xml
res/layout
1.4m articles
1.4m replys
5 comments
57.0k users