title: How to replace one view with another android
body: <p>I have two layouts as shown in the below image. In the second layout I have two buttons. When user clicks on the button1 layout 2 should occupy whole screen and layout1 should be invisible.When button 2 is pressed again it should show the normal view of both layouts.</p>
  
  <p>Initial views :</p>
  
  <p><a href="https://i.stack.imgur.com/J4SVa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J4SVa.png" alt="initial page view"></a></p>
  
  <p>When button 1 is pressed :</p>
  
  <p><a href="https://i.stack.imgur.com/UITec.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UITec.png" alt="when button 1 is pressed"></a></p>
  
  <p>When button2 is pressed original view should be displayed again.</p>
  
  <p><a href="https://i.stack.imgur.com/lvM9Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lvM9Y.png" alt="enter image description here"></a></p>