【发布时间】:2011-06-06 15:59:38
【问题描述】:
我不知道为什么我的应用不喜欢以下内容,如果能提供任何帮助,我将不胜感激。
我有一个设置以下 onCreate 的主要活动
setContentView(new Splash(this));
Splash 是一个表面视图,其构造函数中包含以下内容
this.setBackgroundDrawable(getResources().getDrawable(R.drawable.splash));
然后我在 Splash 中有一个等待 3 秒或 3000 毫秒的线程。
然后在主activity中调用第二个surfaceview
setContentView(new GameCanvas(this));
一切正常,直到它调用 seoncds setContentView,屏幕没有改变,它停留在启动屏幕上。
知道为什么吗?
这是我的话题
new Thread(){
public void run(){
try{
Log.e("here", "sleeping");
sleep(3000);
//main being the main activity class
main.killSplash();
//Log.e("here", "KILL SPLASH");
}catch(Exception e){
//
}
}
}.start();
ps 我有一种感觉是因为我是从线程内部调用 switch canvas 方法
【问题讨论】:
标签: android multithreading canvas splash-screen