implement seek bar in media player on android
<p>in my app i am storing all song file name,path from sdcard into data base and play one by one with seek bar. my problem is i get null pointer exception println needs a message.
the file name is exist and valid one.</p>

<p>my code:</p>

<pre><code> playsong(filename);  // line no 92 
  ....
    private void playsong(String filename2) {
    try{
        Log.e("sdcard",filename2);
        mediaPlayer.setDataSource(filename2); // line no 192
        seek.setMax(mediaPlayer.getDuration());
        mediaPlayer.prepare();
        mediaPlayer.start();
        myHandler.post(runn);
        isPlaying = true;
        mediaPlayer.setOnCompletionListener(this);          
    }
    catch(Exception ex){
        Log.e("sdcard-err2:",ex.getMessage()); // line no 204
    }

}
</code></pre>

<p>my logcat</p>

<pre><code>   05-16 17:46:41.648: ERROR/AndroidRuntime(5641): Uncaught handler: thread main exiting due to uncaught exception
  05-16 17:46:41.711: ERROR/AndroidRuntime(5641): java.lang.NullPointerException: println needs a message
  05-16 17:46:41.711: ERROR/AndroidRuntime(5641):     at android.util.Log.println(Native Method)
  05-16 17:46:41.711: ERROR/AndroidRuntime(5641):     at android.util.Log.e(Log.java:208)
  05-16 17:46:41.711: ERROR/AndroidRuntime(5641):     at  com.seek.bar.main.playsong(main.java:204)
  05-16 17:46:41.711: ERROR/AndroidRuntime(5641):     at com.seek.bar.main.access$0(main.java:192)
  05-16 17:46:41.711: ERROR/AndroidRuntime(5641):     at com.seek.bar.main$2.onClick(main.java:92)

     ...
</code></pre>

<p>please help me.</p>
