Почему не выполняется условие в java коде? Вот код
String temps=server.getOnliOff(position);
if(temps!="off"){
SharedPreferences mServer = getSharedPreferences("mServer", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = mServer.edit();
editor.putString("mServer", server.getName(position));
editor.apply();
Intent intent = new Intent(this, Autorizes.class);
startActivity(intent);
finish();
} else toster("Сервер не доступен");
toster("'"+temps+"'");
Сделал я специально функцию toster("'"+temps+"'");
чтобы увидеть что там и вот что в перменной