开发者

How to check Programmatically the volume of phone in android?

开发者 https://www.devze.com 2023-03-10 20:58 出处:网络
I am developing an application in which i will play music..Now i want to check whether the user has reduced the volume 开发者_如何学编程of the phone or not... I want the music to play at a particular

I am developing an application in which i will play music..Now i want to check whether the user has reduced the volume 开发者_如何学编程of the phone or not... I want the music to play at a particular volume...How to do it?


You can use AudioManager.getStreamVolume to fetch the current volume for the media player stream (See STREAM_MUSIC), and AudioManager.setStreamVolume to set it.

0

精彩评论

暂无评论...
验证码 换一张
取 消