code: public synchronized void setMax(int max) {
          if (max < 0) {
              max = 0;
          }
          if (max != mMax) {
              mMax = max;
              postInvalidate();
  
              if (mProgress > max) {
                  mProgress = max;
              }
              refreshProgress(android.R.id.progress, mProgress, false);
          }
      }
docs: <p>Set the range of the progress bar to 0...<tt>max</tt>.</p>
  
  @param max the upper range of this progress bar
  
  @see #getMax()
  @see #setProgress(int)
  @see #setSecondaryProgress(int)