I'm starting adding sound to splash.java but im getting an error also I think everything is good so you might see it and help me with that I'm gonna be really greatful
the error im getting is :
Multiple markers at this line
- Syntax error on token ".", class expected after this token
- The method create(Context, Uri) in the type MediaPlayer is not applicable for the arguments (Splash,
on the line
MediaPlayer start = MediaPlayer.create(Splash.this, R.raw.splashsound);
my program is :
package com.sc.uploader;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
public class Splash extends Activity {
@Override
protected void onCreate(Bundle IloveU) {
// TODO Auto-generated method stub
super.onCreate(IloveU);
setContentView(R.layout.splash);
MediaPlayer start = MediaPlayer.create(Splash.this, R.raw.splashsound);
start.start();
Thread timer = new Thread(){
public void run(){
try{
sleep(5000);
} catch (InterruptedException e){
e.printStackTrace();
}finally {
Intent openStarting = new Intent("com.sc.uploader.MAINACTIVITY");
startActivity(openStarting);
}
}
};
timer.start();
}
}
if you could know what is the error and how to fix it i will be really greatful .