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;
}
}
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;
}
}
'개발도구 > aOS - 안드로이드 개발' 카테고리의 다른 글
[안드로이드] 타이틀바 없애기 (0) | 2011.05.24 |
---|---|
Log.d 숫자 찍어보기 (0) | 2011.05.23 |
[안드로이드] ListView에 header 을 달자! - addHeaderView (0) | 2011.05.23 |
[Android] addHeaderView -ListActivity with a header or footer (0) | 2011.05.20 |
[안드로이드] Gallery View (0) | 2011.05.19 |