Xml Parsing in android
<p>guys I have a problem in my program that it returns an Exception as Unable to start activity and gives Force Close to my applicatio of Xml Parsing. Please review my code and help me.</p>

<p>code: package com.ex.createXml;</p>

<pre><code>import java.net.URL;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;


public class XmlParsingExample extends Activity{
/*Create Object SitesList Class*/
SitesList siteslist = null;

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(1);
    TextView name[];
    TextView websites[];
    TextView category[];
    try{
        /*Handling Xml*/
        SAXParserFactory spf = SAXParserFactory.newInstance();
        SAXParser sp = spf.newSAXParser();
        XMLReader xr = sp.getXMLReader();


        URL sourceurl = new URL("http://www.androidpeople.com/wp-content/uploads/2010/06/example.xml");
        MyXmlHandler mxh = new MyXmlHandler();
        xr.setContentHandler(mxh);
        xr.parse(new InputSource(sourceurl.openStream()));


    }catch(Exception e)
    {
        System.out.println("Xml Parsing Exception="+e);

    }
    siteslist = MyXmlHandler.siteslist;
    name = new TextView[siteslist.getName().size()];
    websites = new TextView[siteslist.getWebsite().size()];
    category = new TextView[siteslist.getCategory().size()];

    /** Set the result text in textview and add it to layout */
    for (int i = 0; i &lt; siteslist.getWebsite().size(); i++) {
    name[i] = new TextView(this);
    name[i].setText("Name = "+siteslist.getName().get(i));
    websites[i] = new TextView(this);
    websites[i].setText("Website = "+siteslist.getWebsite().get(i));
    category[i] = new TextView(this);
    category[i].setText("Website Category = "+siteslist.getCategory().get(i));

    layout.addView(name[i]);
    layout.addView(websites[i]);
    layout.addView(category[i]);
    }
    setContentView(layout);
}

}
</code></pre>
