Android Open Source - GeoDeals-android Splash Activity






From Project

Back to project page GeoDeals-android.

License

The source code is released under:

GNU General Public License

If you think the Android project GeoDeals-android 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

/**
 * GeoMoby Pty Ltd//  w  w  w  .ja  va2 s. co m
 * http://www.geomoby.com
 * Copyright GeoMoby Pty Ltd 2013
 * 
 * @author Chris Baudia
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.geomoby.geodeals.splash;

import com.geomoby.geodeals.R;
import com.geomoby.geodeals.MainActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;

public class SplashActivity extends Activity {

  private static String TAG = SplashActivity.class.getName();
  private static long SLEEP_TIME = 3;  // Sleep for some time (3s)
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);  // Removes title bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // Removes notification bar

    setContentView(R.layout.geomoby_splash);

    // Start timer and launch main activity
    IntentLauncher launcher = new IntentLauncher();
    launcher.start();
  }

  private class IntentLauncher extends Thread {
    @Override
    /**
     * Sleep for some time and than start new activity.
     */
    public void run() {
      try {
        // Sleeping
        Thread.sleep(SLEEP_TIME*1000);
      } catch (Exception e) {
        Log.e(TAG, e.getMessage());
      }

      // Start main activity
      Intent intent = new Intent(SplashActivity.this, MainActivity.class);
      SplashActivity.this.startActivity(intent);
      SplashActivity.this.finish();
    }
  }
}




Java Source Code List

com.geomoby.geodeals.DemoService.java
com.geomoby.geodeals.MainActivity.java
com.geomoby.geodeals.notification.CustomNotification.java
com.geomoby.geodeals.receiver.ServiceStarter.java
com.geomoby.geodeals.splash.SplashActivity.java