package mh.adib.shiveh;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;

public class Splash extends Activity {
	CountDownTimer timer;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.splash);
		
		timer=new CountDownTimer(5000,1000) {
			
			@Override
			public void onTick(long arg0) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void onFinish() {
				// TODO Auto-generated method stub
				finish();
				startActivity(new Intent(Splash.this, Menu.class));
				overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
			}
		}.start();
	}
	
	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
		timer.cancel();
		finish();
	}
}
