I'm trying to play an mp3 file from a website. The following code gives me no errors but it doesn't play the mp3.
Android version is 2.2 and I'm testing it on my HTC Magic.
Edit: it works when I run it on a virtual device v. 2.2. If you know why it doesn't work on my HTC Magic, I would very much like to know.
Fix'd :)
The media volume was 0 on my phone, which explains why it only works on the virtual device. I fixed this by adding this line to the onCreate method:
this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.