반응형
Handler h;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_intro);
setActivity();
}
@Override
public void setActivity() {
final LinearLayout linear = (LinearLayout)
View.inflate(this, R.layout.activity_intro_dialog, null);
new AlertDialog.Builder(this)
.setTitle("Login Process")
.setView(linear)
.setPositiveButton("Login", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
h = new Handler();
h.postDelayed(irun, 4000);
}
})
.setNegativeButton("Exit", null)
.show();
}
Runnable irun = new Runnable() {
public void run() {
Intent i = new Intent(IntroActivity.this, MenuActivity.class);
startActivity(i);
finish();
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
};
@Override
public void setListener() { }
public void goOtherActivity(String where) { }
public void warmToast(String msg) { }
public void onBackPressed() {
super.onBackPressed();
h.removeCallbacks(irun);
}
반응형
'Android' 카테고리의 다른 글
| 레이아웃 둥근 모서리 (0) | 2013.05.05 |
|---|---|
| StartActivityForResult 결과를 받을 수 있는 인텐트 실행 법 (0) | 2013.05.04 |
| TextView 줄임 표시 (0) | 2013.03.03 |
| 안드로이드 레이아웃에 줄 긋는 방법 (0) | 2013.03.03 |
| [Intent] 명시적 전달과 묵시적 전달 (0) | 2013.02.21 |
WRITTEN BY
,




