I need to disable a button based on one parameter present month . Here is my code
if(presentMonth > 20)
{
nextMonth.setClickable(false);
nextMonth.setOnClickListener(null);
}
else
{
nextMonth.setOnClickListener(new MyListener());
}
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.
I think the methods should work,cause they are meant for that.
setEnabled()and yes I have used one other way I remember that like