Well i was working on optimizing my app,and i thought that each time we are setting up a listener,generally we do it like this
fadeOut.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationStart(Animation animation) {
}
});
and in this way,are we creating a new object everytime by not providing a variable name to it?i mean suppose I want to set the listener for fadeOut twice,won't it take twice the space for the two listeners that have been created ?shouldn't I create a variable instead ?and keep writing it over whenever needed?
will fadeOut.setAnimationListener(null) clear out all the variables that have been created ? Does this common practice takes so less memory that it can be ignored?