code: private void obtainWindowBackground(@StyleRes final int themeResourceId) {
          TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                  new int[]{R.attr.materialDialogWindowBackground});
          int resourceId = typedArray.getResourceId(0, 0);
  
          if (resourceId != 0) {
              setWindowBackground(resourceId);
          } else {
              setWindowBackground(R.drawable.material_dialog_background);
          }
      }
docs: Obtains the window background from a specific theme.
  
  @param themeResourceId
  The resource id of the theme, the window background should be obtained from, as an
  {@link Integer} value