This question has been asked a few times, but I still could not find a answer.
I'm updating the progress on my SeekBar
using a Handler
, like this:
Handler handler = new Handler();
private Runnable runnableCode = new Runnable() {
@Override
public void run() {
mSeekBar.setProgress(mPlayer.getDuration());
handler.postDelayed(runnableCode, 2000);
}
};
// Start the initial runnable task by posting through the handler
handler.post(runnableCode);
After looking at this question.
The problem is that I'm experiencing lag. Every time the SeekBar
gets update, there is a small lag.
Please note that I'm not talking about when the user 'manually' selects the SeekBar
. I know I should check if(fromUser)
in onProgressChanged
when doing that.
Also, I did try a Timer
with the same result.
Has anybody experienced this issue and how should I going about resolving this?