Witam Wszystkich.Dopiero zaczynam swoja zabawe Z androidem,Chcialem zapytac was jak moge zrobic obsluge wyjatku jesli do pola waga/wzrost poda sie litere to wtedy chcial bym zeby pojawialo sie powiadomoenie toast . Chcialem abyscie pomogli mi zrobic obsluge wyjatkow.Pozdrawiam
public void Oblicz_BMI(View view) {
double tempWeight=1;
double tempHeight=1;
double YourBMI;
EditText Weight = (EditText) findViewById(R.id.WeightID);
tempWeight = Double.parseDouble(Weight.getText().toString());
EditText Height = (EditText) findViewById(R.id.HeightID);
tempHeight = Double.parseDouble(Height.getText().toString());
YourBMI = tempWeight / (tempHeight*tempHeight);
Intent intent = new Intent(MainActivity.this,Druga.class);
intent.putExtra("BMI",YourBMI);
startActivity(intent);