I have a button that basically looks like this:
<Button
android:id="@+id/admin_new_questions"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="See Asked Questions"
/>
and I try to display it only in some cases like this:
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)
{
....
}
});
}
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.
How can I make the button show up only when the clause is true?
Thanks!