package com.powenko.Tutorial_thread_AsyncTask;

import org.w3c.dom.Document;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;

public class Tutorial_thread_AsyncTaskActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        new ParseXMLFile().execute();
    }

    ///
	Document document = null;
    void setDocument(Document document){ this.document = document; }
    private class ParseXMLFile extends AsyncTask<Integer, Integer, Document>{
        @Override public void onPostExecute(Document d){ setDocument(d); }

        @Override
        protected Document doInBackground(Integer... params) {

            Document parsedXML = null;
            return parsedXML;
        }
    }
}

sample code:

Tutorial_thread_AsyncTask

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply