Splash screen in android
The purpose of the splash screen.1.Downloading data and storing in SQLite database
2.Downloading required images.
3.Fetching and parsing JSON/XML
4.sending device information/registering the device to our server
//Here you have to set splash screen layout.
splash_screen.xml
|
Splashscreen.Java
public class Splash extends Activity { TextView txt_head; // Splash screen timer private static int SPLASH_TIME_OUT = 3000; Typeface font; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splashscreen); txt_head=(TextView)findViewById(R.id.txt_splash_head); txt_head.setTypeface(font); new Handler().postDelayed(new Runnable() { @Override public void run() { // This method will be executed once the timer is over / / Start your app main activity Intent i = new Intent(Splash.this, Headline_main.class); startActivity(i); // close this activity finish(); } }, SPLASH_TIME_OUT); } } |
No comments:
Post a Comment