So i get an error for this piece of code.
MediaPlayer mp = MediaPlayer.create(this, R.raw.whippingsound);
An the errors for this line (Eclipse Ide) is:
The method create(Context, int) in the type MediaPlayer is not applicable for the arguments (new View.OnClickListener(){}, int)
Now what am i missing in the parenthesis and can you explain to me what it is? Thanks! Whippingsound is my audio and raw is the folder. Thanks Guys!
Seems like you are creating the MediaPlayer in some listener, which is an internal (anonnymous) class, which its “this” hides the Activity
this. You need to give the fully qualified “this” as an argument, assuming your activity is called MyActivity, it should be: