Change theme for button programmatically
<p>I can able to set theme to button using <code>android:theme</code> attribute in xml. Is there any equivalent programmatical code?</p>

<pre><code>&lt;Button
        android:id="@+id/btnPayment"
        android:layout_height="wrap_content"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:text="Add Payment"
        android:theme="@style/ButtonPeter" // theme..
        /&gt;
</code></pre>

<p><strong>style.xml</strong></p>

<pre><code>&lt;style name="ButtonPeter" parent="Widget.AppCompat.Button"&gt;
        &lt;item name="colorButtonNormal"&gt;@color/fbutton_color_peter_river&lt;/item&gt;
        &lt;item name="android:textColor"&gt;@android:color/white&lt;/item&gt;

    &lt;/style&gt;
</code></pre>

<p>Can I able to set theme dynamically using something like this <code>btnPayment.setTheme(R.style.ButtonPeter)</code> ? </p>

<p>I search a lot but all posts are related to set <code>style</code> or create dynamic <code>button</code> and apply style to it but I dont want to do that .I want to set <code>theme</code> to <code>button</code></p>

<p>How to achieve this?</p>