BackgroumdTask returns null.Why? It should return the string specified in try block : BackgroumdTask returns null.Why? It should return the string specified in try block.


@Override
        protected String doInBackground(Void...Voids)
        {


                try {

                    URL url = new URL(json_url);
                    HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
                    InputStream ip = httpURLConnection.getInputStream();
                    BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(ip));

                    StringBuilder sb = new StringBuilder();
                    while ((json_string = bufferedreader.readLine())!= null)
                    {
                        sb.append(json_string + "\n");
                    }
                    bufferedreader.close();
                    ip.close();
                    httpURLConnection.disconnect();
                    return sb.toString().trim();
                    
                }
                catch (MalformedURLException e)
                {
                    e.printStackTrace();
                }
                catch (IOException e)
                {
                    e.printStackTrace();

                }



                            return null;
        }