displaying progressbar using threading
<p>I am trying to display a progress bar using threading .. i accpt that i donot have that much concept of threading.</p>

<p>here is the code</p>

<pre><code>enter code here

package com.integrated.mpr;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;

public class Progress extends Activity {


    static String[] display;

    private static final int Progress = 0;

    private ProgressBar mProgress;
    private int mProgressStatus = 0;

    private Handler mHandler = new Handler();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.progress);


        mProgress = (ProgressBar) findViewById(R.id.progressBar);

        // Start lengthy operation in a background thread
        new Thread(new Runnable() {
            public void run() {
                while (mProgressStatus &lt; 100) {
                    mProgressStatus = doWork();

                    // Update the progress bar
                    mHandler.post(new Runnable() {
                        public void run() {
                            mProgress.setProgress(mProgressStatus);
                        }
                    });
                }
            }

            private int doWork() {

                display = new Logic().finaldata();
                // TODO Auto-generated method stub
                return 100;
            }
        }).start();
    }
}
</code></pre>

<p>on running the logcat message is </p>

<p>java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</p>

<p>what is the mistake i am doing ??
plz help    </p>
