Android Seekbar bind to value

I have created an Android app that contains 3 search bars. I want it to snap to the mean when u is scrolled. So if the maximum search width is 100, it will snap to 50 when it gets close to that value.

Can anyone help me with this?

EDIT : I was able to create something that works:

public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
                                            // TODO Auto-generated method stub
                                            if (progress > 90 && progress < 110 ) {
                                                progress = 100;


The search bar has a maximum of 200


source to share

All Articles