I've try to copy a very small and easy sample of using MediaPlayer
(for example in http://developer.android.com/guide/topics/media/index.html)
but I dont know the reason I get an IllegalStateException.

Code can be sumarized as:
MediaPlayer mp = MediaPlayer.create(myclass_name_here.this,
R.raw.clip);
        boolean error=true;
        try {
                mp.prepare();
                error=false;
        } catch (IOException ioe) {
                Log.w("Player","Error: "+ioe.getMessage());
        }
        if(!error) {
                mp.start();
        }

I have a raw directory under res, it has the "clip.mp3" file, I've
check the file is ok, so why I get a java.lang.IllegalStateException
in  mp.prepare(); I've tested in 2 different android phones.

Best regards.

-- 
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

Reply via email to