Need to Implement Progress bar and thread
<p>I had function that communicate with webservice and insertion of data to the datbase occur
during this function execution....I cant predict how much time it will take to execute the function.</p>

<p>The problem is that i need to show a progess bar which end when the function execution stop.It need to show progress.</p>

<p>Or is there any other option that show the commuction is in progress....</p>

<p>My function is as given below....</p>

<pre><code>public Boolean startdownload() {    


        downloadhelper = new download_helper(this);

        downloadhelper.DownloadProblemAndReasonCode();      

        pkManifest=downloadhelper.DownloadNewManifest();        

        downloadhelper.DownloadNewMessages();


        return True;
    }
</code></pre>

<p>Also i have implement thread on the onclick event of Start button.......</p>

<pre><code>start_button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                                Status.setText("Download in Progress....");
                new Thread(new Runnable() {
                    public void run() {
                        try {

                                startdownload();
                                onStop();
                                isRunning=false;
                        } catch (Throwable t) {
                            t.toString();
                        }

                    }
                   }).start();              

                if (isRunning=false)
                {
                    Status.setText("Download Completed");
                }

            }
        });
</code></pre>
