title: I try to login but it does not run the whole query
body: <p>When I put something wrong, I receive everything in onResponse but it does not go for the function resultado() and when I put all the data well, it goes to the function resultaod() but only until the time to assign the values ​​to usuario and from the toast it is not executed.</p>
  
  <p>Login Activity</p>
  
  <pre><code>public class LoginActivity extends AppCompatActivity {
  
  private RelativeLayout parentLayout;
  private EditText txtUsuario, txtContraseña;
  private TextView txtVersion;
  private CheckBox chxRecordar;
  private Button btnEntrar;
  private SharedPreferences myPreferences;
  private Usuario usuario;
  private String codes, status, token;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login);
      iniciarComponentes();
  
      btnEntrar.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              verificarInicio();
          }
      });
  }
  
  private void iniciarComponentes() {
      parentLayout = findViewById(R.id.parent_layout);
      txtUsuario = findViewById(R.id.txt_usuario);
      txtContraseña = findViewById(R.id.txt_password);
      chxRecordar = findViewById(R.id.chx_recordar);
      btnEntrar = findViewById(R.id.btn_entrar);
      txtVersion = findViewById(R.id.txt_version);
      txtVersion.setText("Version " + BuildConfig.VERSION_NAME);
      myPreferences = PreferenceManager.getDefaultSharedPreferences(this);
  }
  
  private void verificarInicio() {
      String url = Common.BASE_URL + "usuario";
      if (validarSesion()) {
          Log.d("verificarInicio: ", url);
          final String usuario = txtUsuario.getText().toString();
          final String contraseña = txtContraseña.getText().toString();
          final android.app.AlertDialog dialog = new SpotsDialog.Builder().setContext(this).setMessage("Cargando...").setCancelable(false).build();
          dialog.show();
          RequestQueue requestQueue = Volley.newRequestQueue(LoginActivity.this);
          final StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response) {
                  try {
                      JSONObject jsonObject = new JSONObject(response);
                      codes = jsonObject.getString("code");
                      status = jsonObject.getString("status");
                      token = jsonObject.getString("token");
                      resultado(codes, status, jsonObject, token);
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  Snackbar.make(parentLayout, error.getMessage(), Snackbar.LENGTH_LONG).show();
                  dialog.dismiss();
              }
          }) {
              @Override
              protected Map&lt;String, String&gt; getParams() {
                  HashMap&lt;String, String&gt; parametros = new HashMap&lt;&gt;();
                  parametros.put("dni", usuario);
                  parametros.put("password", contraseña);
                  return parametros;
              }
          };
          requestQueue.add(stringRequest);
          requestQueue.addRequestFinishedListener(new RequestQueue.RequestFinishedListener&lt;String&gt;() {
              @Override
              public void onRequestFinished(Request&lt;String&gt; request) {
                  if (dialog.isShowing())
                      dialog.dismiss();
              }
          });
      }
  }
  
  private void resultado(String codes, String status, JSONObject jsonObject, String token) throws JSONException {
      if (codes.equals("100")) {
          JSONArray array = jsonObject.getJSONArray("result");
          JSONObject dato = array.getJSONObject(0);
          usuario = new Usuario(dato.getString("NombreCompleto"),
                  dato.getString("estado"),
                  dato.getString("foto"),
                  dato.getString("nombre_Aso"),
                  dato.getString("nombre_Red"),
                  dato.getString("sexo_Pro"),
                  dato.getInt("campana"));
          Toast.makeText(LoginActivity.this, status, Toast.LENGTH_SHORT).show();
          Common.USUARIO_DNI = txtUsuario.getText().toString();
          guardarUsuario(token);
          Intent intent = new Intent(LoginActivity.this, MainActivity.class);
          intent.putExtra(Common.USUARIO, usuario);
          startActivity(intent);
          finish();
      } else if (codes.equals("200")) {
          Snackbar.make(parentLayout, status, Snackbar.LENGTH_LONG).show();
      } else if (codes.equals("203")) {
          Snackbar.make(parentLayout, status, Snackbar.LENGTH_LONG).show();
      }
  }
  
  
  private boolean validarSesion() {
      if (TextUtils.isEmpty(txtUsuario.getText()) || TextUtils.isEmpty(txtContraseña.getText())) {
          Snackbar.make(parentLayout, "Ingrese su usuario y contraseña", Snackbar.LENGTH_SHORT).show();
          return false;
      }
      return true;
  }
  
  private void guardarUsuario(String token) {
      SharedPreferences.Editor myEditor = myPreferences.edit();
      if (chxRecordar.isChecked()) {
          if (!myPreferences.contains(Common.USUARIO)) {
              myEditor.putString(Common.USUARIO, txtUsuario.getText().toString());
              myEditor.putString(Common.CONTRASEÑA, txtContraseña.getText().toString());
              myEditor.putBoolean(Common.CHECK_ESTADO, chxRecordar.isChecked());
              myEditor.putString(Common.TOKEN, token);
              myEditor.apply();
              if (Common.USUARIO_DNI.isEmpty()) {
                  Common.USUARIO_DNI = myPreferences.getString(Common.USUARIO, "");
              }
          }
      } else {
          myEditor.clear();
          myEditor.commit();
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The whole code is not executed, only a part, I do not know why, I would be grateful if you helped me</p>