How to undo “drag and drop” movement on Android Seekbar?

I read the documents and I can’t figure out how to undo the “drag and drop” on the Seekbar after the panel has been completed.

For example, when I drag the panel to the end, I want the event to happen. However, if I hold my finger on the screen and drag my finger past the SeekBar, it continues to shoot this event even after I reset the Seekbar's progress. How can I prevent this from happening?

thanks

+5
source share
2 answers

Try this .. it works great.

mSeekBar.setEnabled(false); 
+10
source
 seekBarObj.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { int originalProgress; @Override public void onStopTrackingTouch(SeekBar seekBar) { } @Override public void onStartTrackingTouch(SeekBar seekBar) { originalProgress = seekBar.getProgress(); } @Override public void onProgressChanged(SeekBar seekBar, int arg1, boolean fromUser) { if(fromUser == true){ seekBar.setProgress(originalProgress); } } }); 
+7
source

All Articles