Android Question How to detect Seekbar value has finished changing

jimseng

Active Member
Licensed User
Longtime User
Hello. I have a seekbar and I want to submit a mysql query once the user has finished changing its value, not as it is changing because there would be an sql query every time the value changed. Is this possible without having a submit button?
 

stevel05

Expert
Licensed User
Longtime User
Not unless you implement a timer in the callback, to check that the value hasn't been changed for a certain amount of time. Could be just 500ms, but you wouldn't be sure the user won't change it again unless you implement a submit button.
 
Upvote 0

jimseng

Active Member
Licensed User
Longtime User
I thought that might be the case. I took a different approach and crated a transparent panel of the same size on top and used the touch move and up events and track the x position and move the seekbar accordingly. It is a tiny but clunky but seems to work.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Here's an updated version of my old inputslider class that I've added a released callback to, which will do what you want. And you can change the graphics to suit.

i don't know why I didn't think of that before. When I get time, I may look at creating it as a Custom View.
 

Attachments

  • is1.zip
    12.2 KB · Views: 340
Last edited:
Upvote 0
Top