How to increase the ringer & notification volume programmatically in android

后端 未结 1 1585
清酒与你
清酒与你 2020-12-31 20:17

I am trying to enable the ringer normal mode and increase the volume programmatically.

AudioManager mobilemode = (AudioManager)mContext.getSystemService(Cont         


        
相关标签:
1条回答
  • 2020-12-31 21:11

    Replace the line

    mobilemode.setStreamVolume (AudioManager.STREAM_MUSIC,mobilemode.getStreamMaxVolume(AudioManager.STREAM_MUSIC),0);
    

    with below line

    mobilemode.setStreamVolume(AudioManager.STREAM_RING,audioManager.getStreamMaxVolume(AudioManager.STREAM_RING),0);
    
    0 讨论(0)
提交回复
热议问题