I'm writing some programs.Im going to use this programs to tell the situation of the connection. I would only use if-else, and now I want to learn how to use switch case,but I found switch case dont use boolean,The following is what I wrote judgment formula:
if(isConnected) {
//if connection established
btnwifi.setText("Connection");
} else {
btnwifi.setText("Unconnected");
}