Android Open Source - gatoloco Splash Activity






From Project

Back to project page gatoloco.

License

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.

Java Source Code

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();
  }

}




Java Source Code List

com.grumpycat.Config.java
com.grumpycat.GalleryActivity.java
com.grumpycat.MainActivity.java
com.grumpycat.Preview.java
com.grumpycat.SaveActivity.java
com.grumpycat.SnapShotActivity.java
com.grumpycat.SplashActivity.java
com.grumpycat.utils.FileUtils.java