title: ProgressDialog cant stop
body: <p>my app is loading some data from a web server.this time i would like to have a progress dialog in order to avoid a black screen to the app users.</p>
  
  <pre><code> Button ok = (Button) findViewById(R.id.ok);
          ok.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                   MyDialog = ProgressDialog.show( yassou.this, " " , " Loading. Please wait ... ", true);
                      MyDialog.show();
                 // myIntent.username.getText();
                    try {
  
                        Send();
  
                  } catch (IOException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
                    Status();
                    //MyDialog=null;
                } 
  
            });
  </code></pre>
  
  <p>this is the btn witch "onclick" is loading the data.<code>Send()</code>; is a method that sends some data that the user enters to my server,and<code>Status();</code> is a second method that directs me to a new page.unfortunately,as i press the ok button,the app first goes to the second page and secondly appears a non stop progress dialog.Where is my wrong please?</p>