package com.fingerHurdle.www;

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

public class Intro extends Activity {
	Intent intent = null;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		System.gc();

		setContentView(R.layout.intro);

		// 특정 시간 후에 리스트 화면으로 Intent를 보낸다.
		Handler x = new Handler();
		x.postDelayed(new splashhandler(), 1000);
	}

	// 스플레쉬
	public class splashhandler implements Runnable {
		public void run() {
			Intent intent = new Intent(getApplicationContext(),
					MainMenu.class);
			startActivity(intent);

			// finish를 해주어야 뒤로가기 했을때 로고 화면이 나오지 않습니다.
			finish();
		}
	}

	private void clearApplicationCache(java.io.File dir) {
		if (dir == null)
			dir = getCacheDir();
		else
			;
		if (dir == null)
			return;
		else
			;
		java.io.File[] children = dir.listFiles();
		try {
			for (int i = 0; i < children.length; i++)
				if (children[i].isDirectory())
					clearApplicationCache(children[i]);
				else
					children[i].delete();
		} catch (Exception e) {
		}
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		clearApplicationCache(null);
	}
}


