このエラーはアンドロイド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 =真; 保護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
コードが記述に追加されました – Ukjent