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
2.1m questions
2.1m answers
60 comments
57.0k users