Replace the below code in afterTextChanged.
public void afterTextChanged(Editable s) {
if(edtitYear.getText().toString().length()==0||edtitCapacity.getText().toString().length()==0){
calc.setEnabled(false);
}else{
calc.setEnabled(true);
}
}