title: TextView visible invisible using one button in Android
body: <p>I create a button and <code>TextView</code> when I press the button to visible the <code>TextView</code>  its working good but my question was when same button pressed invisible the <code>TextView</code> how can i do this? This is my code:</p>
  
  <pre><code>  &lt;Button
          android:id="@+id/btn1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="Button"
          /&gt;
      &lt;TextView
          android:id="@+id/pas_rules"
          android:layout_width="fill_parent"
          android:layout_height="30dp"
          android:text="welcome"
          android:visibility="gone"/&gt;
  </code></pre>
  
  <p>main activity:</p>
  
  <pre><code> button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View arg0) {
  
              textview.setVisibility(View.VISIBLE);
  
          }
      });
  </code></pre>