안드로이드 3초 후 자동 화면전환 (How to change activity automatically?)
2014. 1. 26. 01:20ㆍPrograming/Android / Java
// 현재 Activity (Current Activity) public class MainActivity extends Activity { @SuppressLint("HandlerLeak") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); Handler handler = new Handler() { public void handleMessage(Message msg) { super.handleMessage(msg); startActivity(new Intent(MainActivity.this, MenuActivity.class)); finish(); } }; handler.sendEmptyMessageDelayed(0, 3000); } } --------------------------------------------------- // 전환 할 Activity (The activity which will be changed after 3 sec.) public class MenuActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_menu); } }
'Programing > Android / Java' 카테고리의 다른 글
안드로이드 인텐트로 전화 걸기 (How to make a call by Intent?) (0) | 2014.01.26 |
---|---|
안드로이드 인텐트로 SMS 보내기 (How to send SMS by using the Intent?) (0) | 2014.01.26 |
안드로이드 타이틀바 없애기 (How to remove the title bar) (0) | 2014.01.26 |
인치를 센티미터롤 변환 (inch to cm) (0) | 2014.01.14 |
java.lang.illegalargumentexception - ContentResolver (0) | 2014.01.10 |