我在 android 4.0 + 上收到此错误,也许是 3.0 + 用户。不是 2.3 以下的用户 我该怎么做才能解决这个问题?希望有一个快速的答案,用户抱怨:(
java.lang.UnsupportedOperationException
at java.lang.Thread.stop(Thread.java:1076)
at java.lang.Thread.stop(Thread.java:1063)
at application.application.Splash$1.run(Splash.java:51)
static int destroy = 0;
protected boolean _active = true; 受保护的 int _splashTime = 5000;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
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("app.app.TABHOST"));
stop();
}
}
};
splashTread.start();
}
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
_active = false;
}
return true;
}
}