Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JSONObject json = null;
- JSONObject json2 = null;
- JSONObject json3 = null;
- date= (String.valueOf(anio)) + "-" + (String.valueOf(mes + 1)) + "-" + (String.valueOf(dia));
- try {
- json = JSONParser.readJsonFromUrl(url1.concat(date)));
- json2 = JSONParser.readJsonFromUrl(url2.concat(id));
- json3 = JSONParser.readJsonFromUrl(url3.concat(date));
- } catch (IOException | JSONException e) {
- e.printStackTrace();
- } catch (Exception e) {
- e.printStackTrace();
- }
- if(json == null || json2 == null || json3 == null){
- String mensajeAlerta = "Verifique su conexión a internet...";
- Intent intent = new Intent(MyActivity.this, SecondActivity.class);
- intent.putExtra("id", id);
- intent.putExtra("name", name);
- intent.putExtra("mensajeAlerta", mensajeAlerta);
- intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- finish();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement