Boîte de Dialogue de progression de l'utilisation avec Fil

voici mon code,

public ProgressDialog loadingdialog;
public void ShowManager() {
    //do something
}
public void startScan() {
      loadingdialog = ProgressDialog.show(WifiManagementActivity.this,
                                              "","Scanning Please Wait",true);
      new Thread() {
          public void run() {
              try {
                    sleep(4000);
                    ShowManager();

              } catch(Exception e) {
                    Log.e("threadmessage",e.getMessage());
              }
              loadingdialog.dismiss();
          }
      }.start();
    }

startScan();

Une base progressdialog fonction, mais sur la ligne où ShowManager() est appelée, d'avoir d'erreur ,

01-07 23:11:36.081: ERROR/threadmessage(576): Only the original thread 
that created a view hierarchy can touch its views.

EDIT:

ShowManager() est une fonction qui permet de changer la vue des éléments. peu de temps quelque chose comme,

  public void ShowManager() 
  {
      TextView mainText = (TextView) findViewById(R.id.wifiText);
      mainText.setText("editted");

  }

OriginalL'auteur ocanal | 2012-01-07