Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void verificar(JSONObject datos)
- {
- try
- {
- String jresultado = datos.getString("resultado");
- if (jresultado.equals("true"))
- {
- JSONObject jdatos = new JSONObject(datos.getString("datos"));
- String u = jdatos.getString("user");
- String p = jdatos.getString("pwd");
- Toast.makeText(MainActivity.this, "Correcto Usuario: "+u+" / Pwd: "+p, Toast.LENGTH_SHORT).show();
- }
- else if(jresultado.equals("false"))
- {
- Toast.makeText(MainActivity.this, "Incorrecto", Toast.LENGTH_SHORT).show();
- }
- else
- {
- Toast.makeText(MainActivity.this, "Error de conexion", Toast.LENGTH_SHORT).show();
- }
- }
- catch (JSONException problema){problema.printStackTrace();}
- }
Add Comment
Please, Sign In to add comment