开发者

Android notification and ringer volumes, a question

The Android phones have a setting that allows you to force the notification volume to match the ringer volume, I can't seem to find that sett开发者_Python百科ing anywhere in SDK, can someone help me find out how to get and set it that specific setting?


You have to use setAudioStreamType(AudioManager.STREAM_RING) in MediaPlayer Class http://d.android.com/reference/android/media/MediaPlayer.html#setAudioStreamType(int)

MediaPlayer mediaPlayer = new MediaPlayer();
mediaPlayer.setDataSource(...)
mediaPlayer.setAudioStreamType(AudioManager.STREAM_RING);
mediaPlayer.prepare();
mediaPlayer.start();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜