Josh wrote:
> I have a media player that plays a sound. I want to call a function as
> soon as the sound is complete but i cant figure out how to do it.
>
> I think im just having a problem with the syntax
>
> i tried '''
> mMediaPlayer.setOnCompleteionListener(hideImage);
>
> private void hideImage(){
> //code here to hide image
> }
>
>
> but that's completely wrong....can someone point me towards the right
> syntax?
setOnCompletionListener() takes a MediaPlayer.OnCompletionListener
object as a parameter. Try something like:
mMediaPlayer.setOnCompletionListener(new
MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
// code here to hide image
}
});
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---