Arnie Schwarzvogel
Arnie Schwarzvogel

Reputation: 1005

Android SeekBar not draggable under some conditions

I have implemented simple SeekBar based slider for volume control (so it should be draggable smoothly). Weird is that with my full code in place, it cannot be dragged - I can only single-click to left or right of the thumb.

Then I remove some code, which has no relation to the SeekBar itself - and it starts working! I am also not using setProgress() at any point, except setting the initial value.

So independently on my code, there is something which prevents from reacting on drag events. Any ideas where to look?

Android 7.0

Upvotes: 1

Views: 610

Answers (1)

Arnie Schwarzvogel
Arnie Schwarzvogel

Reputation: 1005

The problem was in my code: SeekBar change listener called notifyObservers(), one of them was the fragment which contained the SeekBar. Worse, Seekbar was a View placed into the RecycleView, so obviously, calling notifyDataSetChanged() somehow canceled all current events.

Upvotes: 2

Related Questions