How to Increment Seek bar value

android, seekbar

Solution

You have to just update the `onProgressChanged` method as follows.

int yourStep = 25;
public void onProgressChanged(SeekBar seekBar, int progress,
                boolean fromUser) {
progress = ((int)Math.round(progress/yourStep ))*yourStep;
seekBar.setProgress(progress);
textview.setText(progress + "");

}

Hope its help

UPD

I think in your xml you set `android:max="100"` for your `SeekBar`. But you need to set `android:max="101"`, because between `0` and `100` = `101` point's.

just replace

android:max="100"

for

android:max="101"

Problem

I want to create seekbar that is divided into 5 section poor , `below Average` `Average` and `Excellent` , for every step i want increment like this seekbar Default=0 max value = 100; ``` i want seek bar values like this :0,25,50,75,100 ``` how can i achieve this. Thanks

Original source