package com.espritmobile.sim.restocheck;

import com.facebook.Session;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;

public class SplashScreen extends Activity {

	private static int SPLASH_TIME_OUT = 2000;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash_screen);

		new Handler().postDelayed(new Runnable() {

			@Override
			public void run() {
				Session session = Session.getActiveSession();
				if (session != null && session.isOpened()) {
					Intent i = new Intent(SplashScreen.this, StartActivity.class);
					startActivity(i);
					finish();
				} else {
					Intent i = new Intent(SplashScreen.this,
							StartActivity.class);
					startActivity(i);
					finish();
				}
			}
		}, SPLASH_TIME_OUT);
	}
}
