package coatapp.coat;

import android.os.AsyncTask;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class ForecastRequestTask extends AsyncTask<String, Void, String> {

    public String result;

    public static String getForecastRequest(String urlToRead) throws Exception {
        StringBuilder result = new StringBuilder();
        URL url = new URL(urlToRead);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line;
        while ((line = rd.readLine()) != null) {
            result.append(line);
        }
        rd.close();
        return result.toString();
    }


    @Override
    protected String doInBackground(String... params) {

        String forecastRequestResponse = "";

        try {
            forecastRequestResponse = getForecastRequest(params[0].toString());
            result = forecastRequestResponse;
        } catch (Exception e) {
            e.printStackTrace();
        }

        return forecastRequestResponse;
    }

    @Override
    protected void onPostExecute(String message) {
        //process message
    }
}

@@ -253,40 +253,14 @@
    p
-ublic String result;%0A%0A    public
+rivate
  sta
@@ -999,66 +999,9 @@
 s%5B0%5D
-.toString());%0A            result = forecastRequestResponse
+)
 ;%0A  

Simplify class by removing unnecessary stuff