How can I reuse this android button?

I have a button that I use 13 times in the main.xml file of an Android application. I would like XML to be defined for it once, so that I can make changes in one place instead of 13. Each of 13 instances should have its own identifier. What should I do to simplify my XML? I tried using <include>, but it did not work for me. I must have been doing something wrong. I would appreciate it if someone could show me how to do it right. Thank.

Here is the XML for the button I would like to reuse:

<Button
  android:width="70dp" 
  android:layout_marginLeft="10dp"
  android:layout_marginRight="10dp" />
+5
source share
1 answer

" " .

+10

All Articles