我得到這個錯誤在Android 4.0 +,也許3.0 +用戶。不是2.3以下的用戶 我能做些什麼來解決這個問題?希望在快速anwser,用戶抱怨:(Android不支持的線程
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;
保護布爾_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;
}
}
如果你能出示了一下你的代碼,你所得到的例外..我可以試着幫你.. – 5hssba 2012-04-17 19:04:52
代碼添加到describtion – Ukjent 2012-04-17 19:09:28