Android SeekBar progress is not working?
<p>I am trying to add a seekbar to a media player that streams from the internet. However, for some reason it is not working. I am using a handler to update the UI every second.
Here is my code at the bottom:</p>

<pre><code>public class MainActivity extends AppCompatActivity {
MediaPlayer mediaPlayer;
boolean isPrepared = false;
ImageButton imageButton;
Handler handler;
SeekBar seekBar;
TextView notifying;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mediaPlayer = new MediaPlayer();
    mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    imageButton = (ImageButton) findViewById(R.id.imageButton);
    seekBar = (SeekBar) findViewById(R.id.seekBar);
    notifying = (TextView) findViewById(R.id.notifying);

    handler = new Handler();
    final Runnable runnable = new Runnable() {
        @Override
        public void run() {

            if (mediaPlayer != null) {
                int mCurrentPosition = mediaPlayer.getCurrentPosition() / 1000;
                Log.i("message", mCurrentPosition + "");
                seekBar.setProgress(mCurrentPosition);

            }
            handler.postDelayed(this, 1000);
        }
    };
    handler.postDelayed(runnable, 1000);


    try {
        mediaPlayer.setDataSource("Any mp3 souund from the internet");


    } catch (IOException e) {
        e.printStackTrace();
    }
    mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        @Override
        public void onPrepared(MediaPlayer mp) {
            Log.i("message", "prepared");
            isPrepared = true;
        }
    });
    mediaPlayer.prepareAsync();
    seekBar.setMax(mediaPlayer.getDuration());
}

public void play(View view) {
    if (!mediaPlayer.isPlaying() &amp;&amp; isPrepared == true) {
        Log.i("message", isPrepared + "");
        Log.i("message", mediaPlayer.isPlaying() + "");
        Log.i("message", (mediaPlayer.getDuration() / 1000) / 60 + "");
        mediaPlayer.start();
        imageButton.setImageResource(R.drawable.pause);

    } else {

        mediaPlayer.pause();
        imageButton.setImageResource(R.drawable.play);
    }
}

public void stop(View view) {
    if (mediaPlayer != null &amp; mediaPlayer.isPlaying()) {
        mediaPlayer.pause();
        mediaPlayer.seekTo(0);

        imageButton.setImageResource(R.drawable.play);
    }
}

@Override
protected void onDestroy() {
    super.onDestroy();
    if (mediaPlayer != null) {
        mediaPlayer.release();
        mediaPlayer = null;

    }
}
</code></pre>