I am trying to change volume of notifications, but not ringer. However, when I use this function notification and ringer volume are changed.
例:
AudioManager mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
int volNot = mAudioManager.getStreamVolume(STREAM_NOTIFICATION);
int volRing = mAudioManager.getStreamVolume(STREAM_RING);
Log.d(volNot + "," + volRing, "not, ringer");
mAudioManager.setStreamVolume(STREAM_NOTIFICATION, 1, 0);
volNot = mAudioManager.getStreamVolume(STREAM_NOTIFICATION);
volRing = mAudioManager.getStreamVolume(STREAM_RING);
Log.d(volNot + "," + volRing, "not, ringer");
关于结果的<代码>Stream Volume (STREAM_NOTIFICATION, 1, 0) change Value of notifications (STREAM_NOTIFICATION)
to 1, but it also change Value of ringer (STREAM_RING)
to 1.