Android Open Source - AndroidCalculator Splash






From Project

Back to project page AndroidCalculator.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidCalculator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.myfirstapp;
//from ww  w. j  a v  a 2 s .c om
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class Splash extends Activity{

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);
    
  
  Thread timer = new Thread(){
    @Override
    public void run() {
      try {
        sleep(2000);
      }catch(InterruptedException e){
        e.printStackTrace();
      }finally{
        Intent main = new Intent("com.example.myfirstapp.MainActivity");
        
        startActivity(main);
      }
    }
  };
  timer.start();
  
}
  @Override
  protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    finish();
  }
}




Java Source Code List

com.example.myfirstapp.MainActivity.java
com.example.myfirstapp.Splash.java