java.lang.numberformatexception: invalid double: ” “

The reason is, that “” is not a valid double. You need to test the String before or catch such exceptions

double w;

try {
    w = new Double(input3.getText().toString());
} catch (NumberFormatException e) {
    w = 0; // your default value
}

Leave a Comment