title: java.lang.RuntimeException error occured while executing doInBackground()?
body: <p>I am beginner in android, and for a project for a uny course we have to develop 5 simple apps and then "combine" them in one.So you start each app from a single Activity/ListView. <strong>All the apps are running ok individually but when running one app from the listview i get the following</strong>
  *<em>AsyncTask #1
   an error occured while executing doinBackground();</em>*</p>
  
  <pre><code> @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
  
      reportarray= new ArrayList&lt;String&gt;();
  
  
      try {
          URL url = new URL("http://www.yr.no/sted/Sverige/Kronoberg/V%E4xj%F6/forecast.xml");
          AsyncTask task = new WeatherRetriever().execute(url);
      } catch (IOException ioe ) {
          ioe.printStackTrace();
      }
      adapter= new Adapter(this);
      setListAdapter(adapter);
  
  
  
  }
  </code></pre>
  
  <p>It seems that is a thread issue , here is some more code i use</p>
  
  <pre><code>private class WeatherRetriever extends AsyncTask&lt;URL, Void, WeatherReport&gt; {
      protected WeatherReport doInBackground(URL... urls) {
          try {
              return WeatherHandler.getWeatherReport(urls[0]);
          } catch (Exception e) {
              throw new RuntimeException(e);
          } 
      }
  
      protected void onProgressUpdate(Void... progress) {
  
      }
  
      protected void onPostExecute(WeatherReport result) {
          report = result;
  
  
  
  
          runOnUiThread(new Runnable() {
                public void run() {
  
  
  
                    reportarray.add(report.toString());;
  
                    for (WeatherForecast forecast : report) {
                          reportarray.add(forecast.toString());
  
                      }
                  adapter.notifyDataSetChanged();
                }
              });
          PrintReportToConsole();
  
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>LOGCAT OUTPUT</p>
  
  <pre><code>09-10 14:51:36.347: E/AndroidRuntime(1411): FATAL EXCEPTION: AsyncTask #1
  09-10 14:51:36.347: E/AndroidRuntime(1411): java.lang.RuntimeException: An error occured while executing doInBackground()
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.lang.Thread.run(Thread.java:856)
  09-10 14:51:36.347: E/AndroidRuntime(1411): Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at com.example.ass1.VaxjoWeather$WeatherRetriever.doInBackground(VaxjoWeather.java:133)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at com.example.ass1.VaxjoWeather$WeatherRetriever.doInBackground(VaxjoWeather.java:1)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     ... 4 more
  09-10 14:51:36.347: E/AndroidRuntime(1411): Caused by: java.lang.RuntimeException: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at com.example.ass1.WeatherHandler.getWeatherReport(WeatherHandler.java:54)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at com.example.ass1.VaxjoWeather$WeatherRetriever.doInBackground(VaxjoWeather.java:131)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     ... 7 more
  09-10 14:51:36.347: E/AndroidRuntime(1411): Caused by: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.net.InetAddress.lookupHostByName(InetAddress.java:418)
  09-10 14:51:36.347: E/AndroidRuntime(1411):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
  </code></pre>