android:max - How to Set the Maximum Value for a ProgressBar, in XML

public static final int max was added in API level 1
Defines the maximum value the progress can take.
Must be an integer value, such as "100".
By default, the progress bar is full when it reaches 100, a max value is not set.

1. Add a ProgressBar, in XML

2. Add the below line between the ProgressBar tags. This will set the maximum value of the ProgressBar to 300.


3. Compile and run!