In AsynsTask I send a get request
try { URL url = new URL(params[0]); urlConnection = (HttpsURLConnection) url.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.connect(); InputStream inputStream = urlConnection.getInputStream(); StringBuffer buffer = new StringBuffer(); reader = new BufferedReader(new InputStreamReader(inputStream)); String line; while ((line = reader.readLine()) != null) { buffer.append(line); } resultJson = buffer.toString(); } catch (Exception e) { httpClient.onError(e.getMessage()); return null; } When there is an Internet connection, everything is fine, but when there is no application terminates with an error. Question. How to solve this problem?
onPostExecutemethod. I believe that you are trying to refer tonull- temq