On Tue, Feb 24, 2009 at 9:55 PM, madcoder <[email protected]> wrote:
>
> I have successfully implemented the Media Player for my apps, but when
> I tried to use some of the callback methods I ran into a problem.
>
> What I'm trying to do is use Media Player in a reusable (library)
> class.  This MediaPlayer is created by passing the Activity Context to
> it's constructor.  I then use getApplicationContext to avoid any
> potential memory leaks.  This works well and I'm quite happy with it.
>
> My problem is trying to use callbacks.  When I implement
> MediaPlayer.OnPreparedListener in my class (that doesn't extend an
> Activity) I repeatedly get this error:
>
> Illegal State Exception: PrepareAsync called in state 8
>
> This error only occurs on the line:
>
> mp.prepare();

I think that means that the MediaPlayer was already prepared, i.e. you
previously called prepare() on it, or perhaps you used one of the
MediaPlayer.create() methods to create the MediaPlayer.

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