当我的启动屏幕启动时,我在logcat中得到此错误:
11-06 02:36:45.450: E/global(4184): Deprecated Thread methods are not supported.
11-06 02:36:45.450: E/global(4184): java.lang.UnsupportedOperationException
11-06 02:36:45.450: E/global(4184): at java.lang.VMThread.stop(VMThread.java:85)
11-06 02:36:45.450: E/global(4184): at java.lang.Thread.stop(Thread.java:1280)
11-06 02:36:45.450: E/global(4184): at java.lang.Thread.stop(Thread.java:1247)
11-06 02:36:45.450: E/global(4184): at com.example.kostas.splash$1.run(splash.java:38)
这是我的课:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
// thread for displaying the SplashScreen
Thread splashTread = new Thread() {
@Override
public void run() {
try {
int waited = 0;
while(_active && (waited < _splashTime)) {
sleep(100);
if(_active) {
waited += 100;
}
}
} catch(InterruptedException e) {
// do nothing
} finally {
finish();
startActivity(new Intent("com.example.kostas.main"));
stop();
}
}
};
splashTread.start();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
_active = false;
}
return true;
}
第38行是stop();
我的应用程序启动没有问题,但我想修复它..我试图删除“ stop();”但我也遇到另一个错误.
11-06 02:44:56.321: E/(32599): onResume() check 0
11-06 02:44:56.321: E/(32599): onResume() check 1
11-06 02:44:56.321: E/Launcher(32599): setWindowOpaque()
11-06 02:44:56.341: E/(32599): onResume() check 2, mRestoring : false
11-06 02:44:56.341: E/(32599): onResume() check 3
11-06 02:44:56.341: E/(32599): onResume() check 4
11-06 02:44:56.345: E/(32599): onResume() check 5
谢谢