I am trying to return the boolean value from the function.
fun validateDetails(jabberId:String, passwordText: String) {
if(jabberId.isEmpty()){
jabber_id.requestFocus()
jabber_id.error="Jabber id can't be null."
return false
}else if(jabberId.isBlank()){
jabber_id.requestFocus()
jabber_id.error="Jabber id can't be blank."
return false
}else if (passwordText.isNotEmpty()){
password.requestFocus();
password.error="Password can't be null."
return false
}
else{
return true
}
}
Error: The boolean literal does not conform to the expected type Unit.
I know unit is the default return type in kotlin. How will i change this to boolean.
=before the curly brace. And please, indent your code properly.: Boolean.