0

Can anyone tell me what is wrong with this?
App crashes if user input is left blank. I was hoping it would display toast and wait for input.

                EditText userWireInput = (EditText) findViewById(R.id.WireSizeInputET);
                String userWireData = userWireInput.getText().toString();
               double userWire = Double.parseDouble(userWireData);

                if (userWire == 0) {

                    Toast.makeText(ISOM_Int_Results.this, "ENTER WIRE SIZE", Toast.LENGTH_LONG).show();
                    return;
            }
4
Contributors
3
Replies
15
Views
2 Years
Discussion Span
Last Post by rproffitt
0

If it crashes the app, break point it and debug line by line. Knowing exactly which line causes the crash usually makes solving it quite easy.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.