Skip to content

Instantly share code, notes, and snippets.

@vamsitallapudi
Created August 28, 2019 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vamsitallapudi/049e8c75b52eb9df4e06b341e7ba40d0 to your computer and use it in GitHub Desktop.
Save vamsitallapudi/049e8c75b52eb9df4e06b341e7ba40d0 to your computer and use it in GitHub Desktop.
package com.coderefer.androidsplashscreenexample;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
/**
* Created by vamsikrishna on 12-Feb-15.
*/
public class SplashScreen extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timerThread = new Thread() {
public void run() {
try {
sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
Intent intent = new Intent(SplashScreen.this, MainActivity.class);
startActivity(intent);
}
}
};
timerThread.start();
}
@Override
protected void onPause() { // TODO Auto-generated method stub
super.onPause();
finish();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment