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);
DatePicker
The problem
First see your code:
dp2.setVisibility(View.GONE); dp2.setVisibility(View.INVISIBLE); btn2.setVisibility(View.GONE); btn2.setVisibility(View.INVISIBLE);
Here you set both visibility to same field so that's the problem. I give one sample for that sample demo