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
In my case I found that simply clearing the animation on the view before setting the visibility to GONE works.
dp2.clearAnimation();
dp2.setVisibility(View.GONE);
I had a similar issue where I toggle between two views, one of which must always start off as GONE - But when I displayed the views again, it was displaying over the first view even if setVisibility(GONE) was called. Clearing the animation before setting the view to GONE worked.