Android Progress Dialog problem
<p>I try to use a progress dialog. My code:</p>

<p>//Method to load data wire BT</p>

<pre><code>private void dataload() {
    if(D) Log.e(TAG, "++ Data Load Function ++");

    // make discoverable
    Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
    discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
    startActivity(discoverableIntent);

    //Show Progress Dialog
    ProgressDialog dialog = ProgressDialog.show(BluetoothServer.this, "", "Loading, Please wait...", true);

    //Establish server connection
    mAcceptThread = new AcceptThread();
    mAcceptThread.run();

    //End progress dialog
    dialog.dismiss();

    //mAcceptThread.cancel();
}
</code></pre>

<p>Thats inside the main activity, and AcceptThread is in the same class, but extends Thread as a new class. The problem is, that no progress bar shows up.</p>

<p>Where is the problem, do I have to put the AcceptThread in another Activity?</p>

<p>Another problem is, that I get an ANR if the AcceptThread is called. I should be a problem, that it´s not running in the background, but why?</p>

<p>Hope you can help.</p>
