Guest User

Untitled

a guest
Feb 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public void verificar(JSONObject datos)
  2. {
  3. try
  4. {
  5. String jresultado = datos.getString("resultado");
  6. if (jresultado.equals("true"))
  7. {
  8. JSONObject jdatos = new JSONObject(datos.getString("datos"));
  9. String u = jdatos.getString("user");
  10. String p = jdatos.getString("pwd");
  11. Toast.makeText(MainActivity.this, "Correcto Usuario: "+u+" / Pwd: "+p, Toast.LENGTH_SHORT).show();
  12. }
  13. else if(jresultado.equals("false"))
  14. {
  15. Toast.makeText(MainActivity.this, "Incorrecto", Toast.LENGTH_SHORT).show();
  16. }
  17. else
  18. {
  19. Toast.makeText(MainActivity.this, "Error de conexion", Toast.LENGTH_SHORT).show();
  20. }
  21. }
  22. catch (JSONException problema){problema.printStackTrace();}
  23. }
Add Comment
Please, Sign In to add comment