The following method code is available:
private int secs = 0; private void onPlayClick(){ Runnable runnable = new Runnable() { @Override public void run() { double percent = (double) secs/SONG_LENGTH; int progress =(int) (percent*100); seekBar.setProgress(progress); secs++; } }; for (int i = seekBar.getProgress()*SONG_LENGTH/100; i<=SONG_LENGTH;i++) { handler.postDelayed(runnable,1000*i); } } His task is to gradually change the position of the SeekBar slider. However, for some reason, instead of gradually moving, it instantly moves to the end of the SeekBar . What is the problem?