title: How to set notification sound volume programmatically?
body: <p>I have this method in my main activity</p>
  
  <pre><code>private void beep()
  {
      AudioManager manager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
      manager.setStreamVolume(AudioManager.STREAM_NOTIFICATION, 0,
              AudioManager.FLAG_SHOW_UI + AudioManager.FLAG_PLAY_SOUND);
      Uri notification = RingtoneManager
              .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
      Ringtone r = RingtoneManager.getRingtone(getApplicationContext(),
              notification);
      r.play();
  }
  </code></pre>
  
  <p>As I understand, notification sound volume should be regulated by STREAM_NOTIFICATION. But notification always plays with the same volume despite that volume number in setStreamVolume method. Why is that?</p>