The server receives the answer: 0, 1, 2 (with the lines tried and still without result).
if (response.getStatusLine().getStatusCode() == 200) { HttpEntity entity = response.getEntity(); responseLogin = EntityUtils.toString(entity); responseLogin = String.valueOf(responseLogin); } Then, depending on the response, actions are performed.
switch (responseLogin) { case "0": //code break; case "1": //code break; case "2": //code break; default: done = false; Toast.makeText(getApplicationContext(), "Response " + responseLogin, Toast.LENGTH_LONG).show(); break; } The value is, but for some reason does not want to compare.
int temp = Integer.valueOf(responseLogin);switch (temp), exitsjava.lang.NumberFormatException: Invalid int: "0". There are no gaps - Vladimir Saleevintquotes should be removed - iksuy0, but"0"(zero in quotes, three characters)? Print theresponseLoginto the log, but see what's inside. - zRrr