I am parsing an XML from a URL and showing it. I want to show ProgressDialog while my XML Parser Method parse the XML and get it ready to show. The problem I am facing is that no data is shown after ProgressDialog rather it shows blank screen.

Here is my code:

```
ArrayList<XMLItem> items= new ArrayList<XMLItem>();
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.mydata);
    adapter= new MyAdapter(this, R.layout.customcell, items);
    listView= (ListView) findViewById(id.ListView01);
    listView.setAdapter(adapter);

    final ProgressDialog dialog = ProgressDialog.show(this, "", "Loading. Please wait...", true);

    Thread thread=new Thread(new Runnable(){

        public void run(){

            doTheAutoRefresh();
            runOnUiThread(new Runnable(){

                public void run() {
                    if(dialog.isShowing())
                        dialog.dismiss();
                            adapter.notifyDataSetChanged(); //this line throws an exception and if i comment this line, blank screen is shown

                }

            });
        }

        });
        thread.start(); 
}

private void doTheAutoRefresh() {
    handler.postDelayed(new Runnable() {
        public void run(){
            loadData(); // this is where you put your refresh code
            doTheAutoRefresh();
             }
         }, 15000);

}

private void loadData(){
    Document doc;
    try {
        doc = XMLReader.parseURL("my url to parse xml");

    NodeList nl = doc.getElementsByTagName("l");

    for(int i=0; i<nl.getLength(); i++){

        NamedNodeMap np = nl.item(i).getAttributes();

        String t= np.getNamedItem("htn").getNodeValue();
        String sT= np.getNamedItem("atn").getNodeValue();
        XMLItem item= new XMLItem(t, sT);
        items.add(item);

    }
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

```

This code shows ProgressDialog perfectly, but after progress dialog, it shows blank screen. Please help me sorting out this problem.

Thanks