Listen to volume changes events on Android

前端 未结 4 632
梦谈多话
梦谈多话 2020-12-31 09:17

Is there any way to listen to the event of volume change on Android, without just taking over the volume buttons?

The only thing I\'ve found that works is here, but

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 09:33

    Use broadcast receiver VOLUME_CHANGED_ACTION then use AudioManager to obtain current volume.

    
        
             
        
    
    

提交回复
热议问题