How can I accurately change the volume of my app using a seekbar without controlling the volume by the volume buttons on my android device? I have seperate function on the Volume keys on my android that's why I want to use a seekbar to control the volume. Can Anyone please help me?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
This is a custom
View
I've used to adjust the volume level. It works by sliding your finger up, but you could easily change that.SliderView
Using it - make sure you implement
OnValueChangeListener
.It's not exactly what you're asking for, but it should definitely help you out, I think.
Please look at below code . It solves your problem.
@CommonsWare do it like this in https://github.com/commonsguy/cw-omnibus/tree/master/SystemServices/Volume and also set five types of volume using SeekBar
Handling five different types of Volume
And for controlling only Volume use only
music=(SeekBar)findViewById(R.id.music);
andinitBar(music, AudioManager.STREAM_MUSIC);