_trd1 の起動時に例外が発生します。例外を与える理由。アニメーションを設定した imageView があります。_imageCard2 で行ったのと同じように、両方とも正常に動作しています...しかし、新しいスレッドを追加すると、完了後に例外が発生します。
public void AnimFunction() {
TranslateAnimation animation2 = new TranslateAnimation(0, -50, 0, 0);
animation2.setDuration(100); // duration in ms
animation2.setRepeatCount(1);
animation2.setRepeatMode(Animation.REVERSE);
animation2.setFillAfter(false);
_imageView.startAnimation(animation2);
_imageView.setImageResource(R.drawable.b1fv);
// Animation
TranslateAnimation animation = new TranslateAnimation(0, 150, 0, 0);
animation.setDuration(400); // duration in ms
animation.setRepeatCount(1);
animation.setRepeatMode(Animation.REVERSE);
animation.setFillAfter(false);
_imageCard2.startAnimation(animation);
Thread _trd1 = new Thread() {
public void run() {
try {
sleep(2000);
_imageCard2.setImageResource(R.drawable.sk);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
_trd1.start();
}