Android Open Source - Pick-n-Eat-Android Splash Activity






From Project

Back to project page Pick-n-Eat-Android.

License

The source code is released under:

MIT License

If you think the Android project Pick-n-Eat-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

package com.nicolasdu.pick_n_eat;
/*from w  w w.  jav a2  s  .  c o  m*/
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;

import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN;


public class SplashActivity extends ActionBarActivity {

    private static String TAG = SplashActivity.class.getName();
    private static long SLEEP_TIME = 5; // temps d'attente du splash screen en secondes

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);

        this.supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

        setContentView(R.layout.activity_splash);

        IntentLauncher launcher = new IntentLauncher();
        launcher.start();
    }

    private class IntentLauncher extends Thread {
        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();
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}




Java Source Code List

com.nicolasdu.pick_n_eat.ApplicationTest.java
com.nicolasdu.pick_n_eat.MainActivity.java
com.nicolasdu.pick_n_eat.RestaurantActivity.java
com.nicolasdu.pick_n_eat.Restaurant.java
com.nicolasdu.pick_n_eat.Review.java
com.nicolasdu.pick_n_eat.SettingsActivity.java
com.nicolasdu.pick_n_eat.SplashActivity.java
com.nicolasdu.pick_n_eat.YelpManager.java
com.nicolasdu.pick_n_eat.Yelp.java