【发布时间】:2014-02-24 18:31:30
【问题描述】:
目前我正在编写一个 Android 应用程序,并且我正在使用计时器进行启动。我想使用句柄而不是使用计时器,但我无法将其集成到我的代码中:
package com.tesbih;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class Splash extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timer = new Thread(){
public void run(){
try{
sleep(5000);
}catch(InterruptedException e){
e .printStackTrace();
}finally{
Intent openStartingPoint = new Intent ("com.tesbih.TESBIHMAINACTIVITY");
startActivity(openStartingPoint);
}
}
};
timer.start();
}
}
【问题讨论】:
标签: android eclipse handler splash-screen