你需要使用處理程序類來保存幾秒鐘本登錄窗口,處理類提供了可用於顯示圖像的屏幕之前顯示的方法,
如果是不可能的處理方法,那麼請使用類似的OnStart)活動的生命週期方法(等也有很多活動方法ü可以使用
下面是一些有用的代碼到u。 。
private Handler handler;
private final static String DEBUG_TAG = "splashScreen";
public void onCreate(Bundle savedInstanceState) {
Log.i(DEBUG_TAG, "onCreate executes ...");
super.onCreate(savedInstanceState);
setContentView(R.layout.splashscr);
handler = new Handler();
}
public void onResume()
{ Log.i(DEBUG_TAG, "onResume executes ...");
handler.postDelayed(new Runnable()
{
public void run()
{
Intent myIntent= new Intent(SplashScreen.this,TabCls.class);
startActivity(myIntent);
}
}, 1000);
super.onResume();
}
protected void onStart()
{
super.onStart();
Log.i(DEBUG_TAG, "onStart executes ...");
}
protected void onRestart()
{
super.onRestart();
Log.i(DEBUG_TAG, "onRestart executes ...");
}
protected void onPause()
{
super.onPause();
Log.i(DEBUG_TAG, "onPause executes ...");
}
protected void onStop()
{
super.onStop();
Log.i(DEBUG_TAG, "onStop executes ...");
}
protected void onDestroy()
{
super.onDestroy();
Log.i(DEBUG_TAG, "onDestroy executes ...");
}
}