Android button enabling/disabling not working
<p>I need to disable a button based on one parameter present month . Here is my code</p>

<pre><code> if(presentMonth &gt; 20)
 {
     nextMonth.setClickable(false);
     nextMonth.setOnClickListener(null);
 }
 else
 {
    nextMonth.setOnClickListener(new MyListener());
 }  
</code></pre>

<p>Where nextMonth is the Button name, I tried setEnabled , setClickable and  setOnClickListener(null), but the button is not disabled. Is there anything, I am missing here.</p>
