Back to project page gatoloco.
The source code is released under:
GNU General Public License
If you think the Android project gatoloco listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.grumpycat; // w w w. j a v a2 s . co m import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.view.KeyEvent; import android.view.Window; import android.view.WindowManager; public class SplashActivity extends Activity { private long ms = 0; private long splashTime = 2000; private boolean splashActive = true; private boolean paused = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_splash); Thread mythread = new Thread() { public void run() { try { while (splashActive && ms < splashTime) { if (!paused) ms = ms + 100; sleep(100); } } catch (Exception e) { } finally { Intent intent = new Intent(SplashActivity.this, MainActivity.class); finish(); startActivity(intent); } } }; mythread.start(); } }