title: run-time exception when using AsyncTask
body: <p>I'm following the Head First Android Development, I'm stuck in Chapter 3 at the NASA daily image adapter, I've looked through stackOverFlow and on of you guys suggested that I use the AsyncTask,[link] this is the question that was discussing the issue.
  <a href="https://stackoverflow.com/questions/20897456/android-head-first-nasa-daily-image-app">Android Head First &quot;NASA daily image App&quot;</a></p>
  
  <p>and here's the code that I'm trying with:</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
  IotdHandler handler;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      IotdHandler handler=new IotdHandler();
      new AsyncTaskClass().execute();
  }
  
  public class IotdHandler extends DefaultHandler{
      private String url="http://www.nasa.gov/rss/image_of_the_day.rss";
      private boolean inUrl=false;
      private boolean inTitle=false;
      private boolean inDescription=false;
      private boolean inItem=false;
      private boolean inDate=false;
      private Bitmap image=null;
      private String title=null;
      private StringBuffer description=new StringBuffer();
      private String date= null;
  
      public void processFeed()
      {
          try{
              SAXParserFactory factory=SAXParserFactory.newInstance();
              SAXParser parser=factory.newSAXParser();
              XMLReader reader=parser.getXMLReader();
              reader.setContentHandler(this);
              InputStream inputStream=new URL(url).openStream();
              reader.parse(new InputSource(inputStream));
  
          }
          catch(Exception e)
          {
  
          }
      }
  
      private Bitmap getBitmap(String url)
      {
          try
          {
              HttpURLConnection connection=(HttpURLConnection) new URL(url).openConnection();
              connection.setDoInput(true);
              InputStream input=connection.getInputStream();
              Bitmap bitmap=BitmapFactory.decodeStream(input);
              input.close();
              return bitmap;
          }
          catch(IOException ioe)
          {
              return null;
          }
      }
  
      public void startElement(String uri,String localName,String qName,Attributes attributes) throws SAXException
      {
          if(localName.equals("url"))
          {
              inUrl=true;
          }
          else
          {
              inUrl=false;
          }
  
          if(localName.startsWith("item"))
          {
              inItem=true;
          }
          else if(inItem)
          {
              if(localName.equals("title"))
              {
                  inTitle=true;
              }
              else
              {
                  inTitle=false;
              }
  
              if(localName.equals("description"))
              {
                  inDescription=true;
              }
              else 
              {
                  inDescription=false;
              }
              if(localName.equals("pubDate"))
              {
                  inDate=true;
              }
              else
              {
                  inDate=false;
              }
          }
      }
  
      public void characters (char ch[],int start,int length)
      {
          String chars=new String(ch).substring(start,start+length);
          if(inUrl &amp;&amp; url==null){
              image=getBitmap(chars);
          }
          if(inTitle &amp;&amp; title==null)
          {
              title=chars;
          }
          if(inDescription)
          {
              description.append(chars);
          }
          if(inDate &amp;&amp; date==null)
          {
              date=chars;
          }
      }
  
      public Bitmap getImage() {return image;}
      public String getTitle() {return title;}
      public StringBuffer getDescription() {return description;}
      public String getDate() {return date;}
  }
  
  public class AsyncTaskClass extends AsyncTask&lt;Void,Void,Void&gt;
  {
      @Override
      protected Void doInBackground(Void...params) {
          handler.processFeed();
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          resetDisplay (handler.getTitle(), handler.getDate(), handler.getImage(), handler.getDescription());
          super.onPostExecute(result);
      }
  }
  
  private void resetDisplay(String title,String date,Bitmap imageDisplay,StringBuffer description)
  {
      TextView titleView=(TextView) findViewById(R.id.imageTitle);
      titleView.setText(title);
  
      TextView dateView=(TextView) findViewById(R.id.imageDate);
      dateView.setText(date);
  
      ImageView imageView=(ImageView) findViewById(R.id.imageDisplay);
      imageView.setImageBitmap(imageDisplay);
  
      TextView descriptionView = (TextView) findViewById(R.id.imageDescription);
      descriptionView.setText(description);
  }
  
  }
  </code></pre>
  
  <p>Now I had a problem with the doInBackGround method it says (Void...params) what does that mean? Is it the right way to write it? Eclipse is giving me a run-time exception that says:</p>
  
  <pre><code>08-12 20:42:29.894: E/AndroidRuntime(28819): FATAL EXCEPTION: AsyncTask #1
  08-12 20:42:29.894: E/AndroidRuntime(28819): Process: com.example.rssimages, PID: 28819
  08-12 20:42:29.894: E/AndroidRuntime(28819): java.lang.RuntimeException: An error occured while executing doInBackground()
  </code></pre>
  
  <p>thank you for your help</p>