title: Alternative to setColorFilter(int,Mode)
body: <p>I have seen that the following method is deprecated : <code>public void setColorFilter (int color, PorterDuff.Mode mode)</code>. In the Android documentation I have seen the following recommendation:</p>
  <pre><code>This method was deprecated in API level 29.
  use setColorFilter(android.graphics.ColorFilter) with an instance of BlendModeColorFilter
  </code></pre>
  <p>I am trying to replace that method to a non-deprecated method but I have not achieved it. I have seen similar posts to this one but they are kotlin version. How could I replace this deprecated method for a non-deprecated method in Java?</p>
  <p>Thanks</p>
  <p>edit:</p>
  <p>What I had using the deprecated method:</p>
  <pre><code> public static void setcol(TextView dLabel) {
         
  dLabel.getBackground().setColorFilter(color,android.graphics.PorterDuff.Mode.MULTIPLY);
  }
  </code></pre>
  <p>what I have changed to use non-deprecated method that is apparently working to replace the above deprecated method:</p>
  <pre><code> public static void setcol(TextView dLabel) {
             
       dLabel.getBackground().setColorFilter(
                  BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
                          color,
                          BlendModeCompat.SRC_OVER
                  )
          );
  }
  </code></pre>