I have a SeekBar with an OnSeekBarChangeListener app application. Each time a user changes a value, his onProgressChanged () method is launched. It's fine.
But then I try to update the SeekBar move as follows:
seekBar.setProgress(value);
I expect that no events will happen - just the progress of SeekBar will change. But onProgressChanged () is also called in this case.
How can I change the course of SeekBar without triggering events?
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {}
Look at the options. You have a boolean fromUser, use it.
if (fromUser) { ......... ......... }
, . , , - if(). . -Marco -
SeekBar. , onProgressChanged.
SeekBar
onProgressChanged
,
seekBar.setOnSeekBarChangeListener(null); seekBar.setProgress(value); seekBar.setOnSeekBarChangeListener(this);