Created
August 28, 2019 01:34
-
-
Save vamsitallapudi/049e8c75b52eb9df4e06b341e7ba40d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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