I wrote an Android application (in eclipse) that plays a music file as follows:
MediaPlayer mediaPlayer = new MediaPlayer(); try { mediaPlayer.setDataSource(fileName); mediaPlayer.prepare(); mediaPlayer.start(); // mediaPlayer.stop(); } catch (Exception e) { Log.d("Exception---", e.getMessage()); }
When I run it, it does not play the file (and does not show any exception), but when I switch to "debug mode" and trace it line by line, it plays the file. I'm really confused. Could you help me find out what happened?
Thanks.
source share