fauzie811

Untitled

Dec 1st, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. public class SplashActivity extends SherlockActivity {
  2.  
  3.     private long splashDelay = 3000;
  4.  
  5.     @Override
  6.     public void onCreate(Bundle savedInstanceState) {
  7.        
  8.         super.onCreate(savedInstanceState);
  9.         setContentView(R.layout.splash_screen);
  10.        
  11.         TimerTask task = new TimerTask() {
  12.  
  13.             @Override
  14.             public void run() {
  15.                 Intent mainIntent = new Intent(SplashActivity.this, MainActivity.class);
  16.                 startActivity(mainIntent);
  17.                 finish();
  18.             }
  19.            
  20.         };
  21.        
  22.         Timer timer = new Timer();
  23.         timer.schedule(task, splashDelay);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment