I use SeekBar for setting volume. I do the following:
- I get current volume by
getStreamVolume()and pass it toSeekBarelement bysetProgress(). - I listen messages from the
SeekBarelement byonStopTrackingTouch()and set volume bysetStreamVolume().
It works.
But user can change volume by hardware volume controls. I’d like to catch it and change SeekBar pointer position appropriately. How can I do it?
Try the following
The question/answer that biegleux pointed you to is only for the “media keys” on an attached headset, not for the hardware volume up/down keys on the phone itself.