I am trying to set a background for every XML layout in my application, and I am using the same picture for them all. At the moment, I am going through all hundred or so layouts and just typing in the code:
android:background="@drawable/dirtwall"
Into all of the layouts. How would I be able to set it automatically so I wouldn’t have to change other backgrounds as I made more, and so I wouldn’t have to go through all of my XML files?
Also, I am using Eclipse.
You can use styles. This way, you can define all common elements in a single place and then update it only there.
Example
style.xml, which should be located in your project’s/res/values/folderand use it like