Kay Ana Kay Ana - 6 months ago 40
Java Question

Android Splash Screen Delay Fail

I have a splash screen (I was required to use it) that is supposed to show for 3 second prior to the start of my game, unfortunately the game screen will not progress once the splash has started. I thought my code was implemented correctly, but I appear to have erred somewhere. Any help is appreciated.

public class SplashScreen extends AppCompatActivity{

// Splash Screen Timer
private static int SPLASH_TIME_OUT = 3000;

public void OnCreate(Bundle savedInstanceState) {

new Handler().postDelayed (new Runnable() {
public void run() {
Intent i = new Intent (SplashScreen.this, Snake.class);

finish ();

I know many are opposed to adding splash screens due to the fact is makes many users feel like there is a delay to the program, but again, this was not my decision, thus why I wanted to hard code is to a mere 3 seconds.

Answer Source

It's because the misspelling use onCreate instead of OnCreate. The way you are using onCreate method is never executed.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download