As you are using this
double ft = Double.valueOf(editFt.getText().toString());
But when there is No text in TextField it will try to do the above stuff which is don't allowed as it'll generate exception.
- Surround your Code with
try catch
block to handle exception. You can put condition like this
if(lengthofText!=0) { //Then do your stuff } else{ //Nothing }