I have an android application and I have two EditTexts.
The user inputs 'distance' and 'time.
I made an if statement to show an error message if the user didn't filled one of the two inputs:
String strDistance,strTime;
strDistance=edtDistance.getText().toString();
strTime=edtTime.getText().toString();
if(strDistance==null||strTime==null){
    txtError.setText("Please insert the distance and time");
}
else{
    calculateLogic();
    app.setFare(fare);
    Intent intent=new Intent(MainActivity.this,Fare.class);
    startActivity(intent);
}
It works fine if I filled the two inputs.
But when I fill only one of them, the application stops working (I don't get my error message)...
 
     
     
     
     
     
    