KK wrote: > hi Pskink, > That actually worked, I moved the timer.cancel() before releasing the > mediaplayer. But what is the logical reasoning behind this, would you mind > explaining in a word or two? or may be point me to any web reference that > explains the thing. Thanks in advance. > > Regards, > KK > > On Sat, Nov 26, 2011 at 1:56 PM, skink <[email protected]> wrote: > > > > > > > KK wrote: > > > hi, > > > Seems the logcat > > > > > > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0 > > > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): > > > java.lang.IllegalStateException > > > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at > > > android.media.MediaPlayer.getCurrentPosition(Native Method) > > > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at > > > > > com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174) > > > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at > > > java.util.Timer$TimerImpl.run(Timer.java:284) > > > > > > > > > > > > Try to cancel() the timer before releazing media player > > > > Also try to avoid Timer/TimerTask, use Handler instead > > > > pskink > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > >
Sure, read MediaPlayer SDK docs and find out when you may call getCurrentPosition() pskink -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

