I would do it this way:
try {
txtProt = (EditText) findViewById(R.id.Protein); // Same
p = txtProt.getText().toString(); // Same
protein = Double.parseDouble(p); // Make use of autoboxing. It's also easier to read.
} catch (NumberFormatException e) {
// p did not contain a valid double
}
EDIT: "the program force closes immediately without leaving any info in the logcat"
I don't know bout not leaving information in the logcat output, but a force-close generally means there's an uncaught exception - like a NumberFormatException.