i try to use in Text View and i get this error the error is
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.bus/com.example.bus.Bus_maker}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.bus.Buss.setLicense_Number(java.lang.String)' on a null object reference
the is function
public boolean check_Bus(Buss My_Bus) {
int num_ok = 0;
String Error_string="the error is:/n";
if (!check_Bus_License(My_Bus)){
num_ok += 1;
if(Error_nu1) Error_string+="license number most be 7 numbers\n";
else Error_string+="license number most be 8 numbers\n";
}
if (!check_Bus_Date(My_Bus)){
num_ok+=1;
Error_string+="license start date most be before end date\n";
}
if (num_ok==0)
return true;
else {
Error_View = findViewById(R.id.Error_View);
Error_View.setText(Error_string);
return false;
}
}
if i didnt upload the error pleas tell me where i can find the error