I want my DatePicker and the button to be invisible in the begining. And when I press my magic button I want to setVisibility(View.Visible);
The problem
This is for someone who tried all the answers and still failed. Extending pierre's answer. If you are using animation, setting up the visibility to GONE or INVISIBLE or invalidate() will never work. Try out the below solution.
`
btn2.getAnimation().setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
btn2.setVisibility(View.GONE);
btn2.clearAnimation();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
`