title: Dynamically change Material Button background not working
body: <p>I have a Material button, i want to change its background dynamically, i have created drawable xml for that, previously it was working, now its not working, i tried below options, still my button is blue color only</p>
  
  <pre><code>mBtnStudy.setBackgroundResource(R.drawable.switch_left_enabled);
  mBtnStudy.setBackgroundColor(getResources().getColor(R.color.red));
  mBtnStudy.setBackgroundDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.switch_left_enabled));
  mBtnStudy.setBackground(ContextCompat.getDrawable(getActivity(), R.drawable.switch_left_enabled));
  </code></pre>
  
  <p>and xml looks like </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:background="@android:color/white"
      android:layout_height="match_parent"&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:layout_gravity="center"
          android:layout_margin="16dp"&gt;
          &lt;com.google.android.material.button.MaterialButton
              android:id="@+id/btn_study"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="@android:color/white"
              android:text="@string/study"/&gt;
  
          &lt;com.google.android.material.button.MaterialButton
              android:id="@+id/btn_test_yourself"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="@android:color/white"
              android:text="@string/test_yourself"/&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:id="@+id/fragment_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/&gt;
  
  &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p>Drawable </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;!--&lt;corners android:bottomLeftRadius="10dp" android:topLeftRadius="10dp"/&gt;--&gt;
      &lt;solid android:color="#bdbdbd"/&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>What might be the issue?</p>