title: set volume of mediaplayer object using seekbar
body: <p>I wanted to set the volume of my mediaplayer object with the help of seekbar. I used its setVolume() method in my app, but it is of no use as there's no change in volume.
  here's my code: </p>
  
  <pre><code>    setVolumeControlStream(AudioManager.STREAM_MUSIC);
          volumeSeekbar=(SeekBar)findViewById(R.id.seekBar1);
         audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
          volumeSeekbar.setMax(audioManager
             .getStreamMaxVolume(AudioManager.STREAM_MUSIC));
         volumeSeekbar.setProgress(audioManager
                  .getStreamVolume(AudioManager.STREAM_MUSIC));   
  
    volumeSeekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
  
              @Override
              public void onStopTrackingTouch(SeekBar arg0) {
                  // TODO Auto-generated method stub
                  Log.i(tag,"touch stopped");
  
              }
  
              @Override
              public void onStartTrackingTouch(SeekBar arg0) {
                  // TODO Auto-generated method stub
                  Log.i(tag,"touch started");
  
              }
              @Override
              public void onProgressChanged(SeekBar seekBar, int progress,
                      boolean fromUser) {
                  //mp is the mediaplayer object..
                  mp.setVolume(progress, progress);
                  Log.i(tag,"working with seekbar");
                              }
  
          });
      }  
  </code></pre>
  
  <p>audioManager and volumeseekbar are initialized.</p>