Android - how to make a button display on a condition?
<p>I have a button that basically looks like this:</p>

<pre><code> &lt;Button
    android:id="@+id/admin_new_questions"        
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="See Asked Questions"
    /&gt;    
</code></pre>

<p>and I try to display it only in some cases like this:</p>

<pre><code>if ( clause )
{
        Button admin_see_questions = (Button)findViewById(R.id.admin_new_questions);   
        admin_see_questions.setOnClickListener(new Button.OnClickListener() 
        {  
            public void onClick(View v) 
            {
           ....    
            }
        });        
}
</code></pre>

<p>But for some reason, the button is displayed for all cases, but the listenter is not being listened to if the clause is an error.</p>

<p>How can I make the button show up only when the clause is true?</p>

<p>Thanks!</p>
