I have an app where I want to play a music from an url. Means in edittext which music url i will give it will play by click on a button.
I am trying 开发者_高级运维to using ,
mediaPlayer.setDataSource("http://sixpackedgeek.com/leech/files/alive.mp3");
but shows exception as below,
**07-18 14:11:21.711: ERROR/AndroidRuntime(300): FATAL EXCEPTION: main
07-18 14:11:21.711: ERROR/AndroidRuntime(300): java.lang.IllegalStateException
07-18 14:11:21.711: ERROR/AndroidRuntime(300): at android.media.MediaPlayer.setDataSource(Native Method)
**
What should i use here so that every extension of media file will play? Thank you
精彩评论