I get this error on android 4.0 +, maybe 3.0 + users. not users below 2.3
What can I do to fix this ? Hoping on a fast anwser, users are complaining 🙁
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;
protected 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;
}
}
This exception is thrown when you call thread.stop() .. because stop() is already deprecated .So,you should try another way without calling stop method.I think you can remove the stop method.. because once the thread has completed its function it is in dead state.. so can be ignored.. try removing stop()