I would like all the buttons of my android application use the same background image, that’s all buttons have attribute:
android:background="@drawable/my_btn_bg"
Is there any way to define this in one place and take effect in the whole application’s buttons? (instead of define the background on each button component)
I think define inside theme.xml could be a solution, but I do not know how to do it ? Could some one give me some hints?
For Android styles, you reference the preset attributes of R.attr. Here, you want to to reference android:buttonStyle. You can try this :
Also look in this Themes and Styles