Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. JSONObject json = null;
  2. JSONObject json2 = null;
  3. JSONObject json3 = null;
  4. date= (String.valueOf(anio)) + "-" + (String.valueOf(mes + 1)) + "-" + (String.valueOf(dia));
  5. try {
  6. json = JSONParser.readJsonFromUrl(url1.concat(date)));
  7. json2 = JSONParser.readJsonFromUrl(url2.concat(id));
  8. json3 = JSONParser.readJsonFromUrl(url3.concat(date));
  9. } catch (IOException | JSONException e) {
  10. e.printStackTrace();
  11. } catch (Exception e) {
  12. e.printStackTrace();
  13. }
  14.  
  15. if(json == null || json2 == null || json3 == null){
  16. String mensajeAlerta = "Verifique su conexión a internet...";
  17. Intent intent = new Intent(MyActivity.this, SecondActivity.class);
  18. intent.putExtra("id", id);
  19. intent.putExtra("name", name);
  20. intent.putExtra("mensajeAlerta", mensajeAlerta);
  21. intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  22. startActivity(intent);
  23. finish();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement