package kr.co.mt;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Window;

/**
 * 초기화면
 *
 * @author joon
 *
 */
public class Intro extends Activity {
    Handler myHandler = new Handler();
    Runnable myRunnable = new Runnable() {

    public void run() {
        Intent i = new Intent(Intro.this, Host.class);
        overridePendingTransition(R.anim.fade, R.anim.hold);
        i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        Intro.this.startActivity(i);
        finish(); // 백 버튼 눌렀을 경우 어플 완전 종료
        // overridePendingTransition(0,0);
        // startActivity(new Intent(IntroActivity.this, netturn.class));
        }
    };

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.intro);
   
        myHandler.postDelayed(myRunnable, 3000); // 딜레이 지정

    }

    public boolean onKeyDown(int keyCode, KeyEvent e) {
    Log.v(null, "" + keyCode);
            if (keyCode == KeyEvent.KEYCODE_BACK) {
            }
        return false;
    }
    public boolean onKeyDown1(int keyCode, KeyEvent e) {
    Log.v(null, "" + keyCode);
        if (keyCode == KeyEvent.KEYCODE_HOME) {
        myHandler.removeCallbacks(myRunnable);
        }
    return false;
    }
}
Posted by 예배하는 프로그래머