I am working on a game where the player can drag and drop things around the screen. I\'ve got a private method which allows me to simulate a drag/drop event for any of the i
Android will make an exception when you change the view hierarchy in animationEnd.
All you have to do is to postpone your call like this :
@Override
public void onAnimationEnd(Animation animation) {
new Handler().post(new Runnable() {
public void run() {
myLayout.removeView(simulateMovingImg);
}
});
}