Android - visible and invisible buttons
<p>I am trying to get a button to become visible if there is one or more objects in an array, otherwise it will stay invisible.</p>

<p>I am used:</p>

<pre><code>if (positionOverlay.geoPointsArrayList.size() &lt;= 0){
    buttonClear.setVisibility(View.GONE);
    System.out.println("Clear button hidden");
}
else if (positionOverlay.geoPointsArrayList.size() &gt;= 1) {
    buttonClear.setVisibility(View.VISIBLE);
    System.out.println("Clear button visible");
}
</code></pre>

<p>The problem I am having is that it runs and on start up the array i am using is empty, so the button stays invisible, however when I add objects to the array it still stays invisible, suggesting that it doesnt run the code again.</p>

<p>I have placed the code above in the onCreate, could anyone tell me where i have gone wrong?</p>
