title: Seekbar not handling touch events
body: <p>I used seekbar in my application to show audio track position. When the activity is
  started the first time, it is working fine. It is handling touch events, the audio is forwarded or backwarded according to the touch events and the seekbar shaded portion is shown too. That means it is working fine...</p>
  
  <p>But when the activity goes to the background and again returns to the foreground and I try to move the seekbar manually, the song position is forwarded and backwarded according to touch events but the seekbar shaded region is not updated by the touch events from the user...</p>
  
  <p>Why it is so?</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.audioplayer);
      layout = (LinearLayout) findViewById(R.id.audioplayerlayout);
      layoutui1 = (LinearLayout) findViewById(R.id.audiolayoutui1);
      layoutui2 = (LinearLayout) findViewById(R.id.audiolayoutui2);
      c = Calendar.getInstance();
      c.setTimeInMillis(System.currentTimeMillis());
      hour = c.get(Calendar.HOUR_OF_DAY);
      minute = c.get(Calendar.MINUTE);
      audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
      int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
      int curVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
      volControl = (SeekBar) findViewById(R.id.seekbarVolume);
      volControl.setMax(maxVolume);
      muteButton = (ImageButton) findViewById(R.id.mutebutton);
      muteButton.setOnClickListener(this);
      muteButton.setBackgroundColor(color.transparent);
      setwakeupButton = (Button) findViewById(R.id.WakeupAlarmButtom);
      setwakeupButton.setOnClickListener(new OnClickListener() {
      volControl.setProgress(curVolume);
      play = (ImageButton) findViewById(R.id.btnplay);
      // view = (TextView)findViewById(R.id.progressview);
      bar = (SeekBar) findViewById(R.id.seekbartrack);
      textview = (TextView) findViewById(R.id.textView1);
      textview.setText("");
      // listeners...
      play.setOnClickListener(this);
      play.setBackgroundColor(color.transparent);
      application = (videoplayerapplication) getApplication();
      application.play();
      volControl.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
          public void onStopTrackingTouch(SeekBar seekBar) {
          }
          public void onProgressChanged(SeekBar seekBar, int progressvol,
                  boolean fromUser) {
              audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,
                      progressvol, 50);
          }
          public void onStartTrackingTouch(SeekBar seekBar) {
          }
      });
  
      {
          duration = (application.getDuration() / 1000);
          d = (int) (duration);
          Log.v("duraton .....", "" + d);
          bar.setMax(d);
          countdown(d);
          Log.v("The value of keeptrack", "" + toKeepTrackValue);
      }
      bar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
          public void onStopTrackingTouch(SeekBar seekBar) {
          }
          public void onStartTrackingTouch(SeekBar seekBar) {
          }
          public void onProgressChanged(SeekBar seekBar, int progress,
                  boolean fromUser) {
              // check whether the user has touched the bar
              if (fromUser) {
                  application.seekforward(progress);
                  i = progress;
                  prog = progress;
                  count.cancel();
                  countdown((application.getDuration() / 1000) - progress);
              }
          }
      });
  }
  public void countdown(double convert) {
      count = new CountDownTimer((long) (convert * 1000), 1000) {
  
          @Override
          public void onTick(long millisecond) {
              conversion = millisecond;
              StringBuilder b = new StringBuilder();
              b.append("" + conversion / 60000);
              newposition=(int) (conversion / 60000);
              textview.setText(b.substring(0, 4));
              bar.setProgress((int) (conversion / 60000));
              if (toKeepTrackValue == false) {
                  bar.setProgress(i++);
              }
              if (toKeepTrackValue == true) {
                  Log.v("the getseekpos", "" + getSeekPosition);
                  bar.setProgress(getSeekPosition++);
              }
          }
  
          @Override
          public void onFinish() {
              // finish......
              bar.setProgress(0);
              i = 0;
              textview.setText(" 0.0");
              play.setImageResource(R.drawable.play);
              checkAudioTrackFinish = 2;
              textview.setText(" 26:46");
          }
      }.start();
  }
  </code></pre>