I have the following LinearLayout. What I don\'t understand is if I set the background to another image, the padding information are reset. Is there a way to pr
This is the default behavior when changing the background Drawable on a View. According to Romain Guy, one of the Android developers, "The reason why setting an image resets the padding is because 9-patch images can encode padding." See his full answer in a similar question.
The fix is to reset the padding in code each time you change the background drawable.