I have a mediaplayer that streams shoutcast stations. My problem is if the stream stops working for any reason the mediaplayer still trys to load it with prepareaync and I have no way to stop it from loading.
I have tried creating a timer that cancels the progress screen and calls finish()
but this still does not stop the prepareasync from loading.
I also tried doing a sort or url validation with geturlconnection but this does not seem to work either. Any ideas would be much appreciated...
Asked
Active
Viewed 583 times
2

Sumit Singh
- 15,743
- 6
- 59
- 89

user1722885
- 41
- 8
-
To anyone with a similar problem I ended up using [this](http://stackoverflow.com/questions/4971914/safe-to-reset-a-mediaplayer-in-preparing-state) to reset the media player. I also found that this only works on a actual device, the emulator does not behave the same as a device in this scenario. Hope this helps someone! – user1722885 Oct 12 '12 at 11:38
-
[this post](http://stackoverflow.com/questions/4180670/android-mediaplayer-is-preparing-too-long?rq=1) was very helpful also... – user1722885 Oct 12 '12 at 11:44