title: How can I change a button style dynamically in Android?
body: <p>I want to change the style of a button dynamically, i.e. in Java code, something like:</p>
  
  <pre><code>((Button)findViewById(id)).setStyle("@styles/foo")
  
  &lt;resources&gt;
      &lt;style name="foo"&gt;
          &lt;item name="android:adjustViewBounds"&gt;true&lt;/item&gt;
          &lt;item name="android:maxHeight"&gt;100px&lt;/item&gt;
          &lt;item name="android:maxWidth"&gt;200px&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>I have not seen nothing like setStyle, so:</p>
  
  <p>do I have to change every single property or I can change the whole style?</p>