diff --git a/Weatherpractice/app/src/main/java/com/example/weatherpractice/MainActivity.java b/Weatherpractice/app/src/main/java/com/example/weatherpractice/MainActivity.java index 0d71304..4c7c52d 100644 --- a/Weatherpractice/app/src/main/java/com/example/weatherpractice/MainActivity.java +++ b/Weatherpractice/app/src/main/java/com/example/weatherpractice/MainActivity.java @@ -51,58 +51,56 @@ public void find (View view) //onclick public void onResponse(JSONObject response) { try { // Log.i("response", response.getString("weather")); - JSONArray arr = new JSONArray(response.getString("weather")); - for(int i=0;i() { - @Override - public void onResponse(JSONArray response) { + JsonObjectRequest jsonObjectRequest1 = new JsonObjectRequest(Request.Method.GET, + "https://api.openweathermap.org/data/2.5/weather?q=london&appid=4a91b112d83a2c5fdb11d3347cd4dd9f", null, new Response.Listener() { + public void onResponse(JSONObject response) { try { - JSONArray arr = new JSONArray(response.getString(Integer.parseInt("main"))); - for(int i=0;i