title: Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46029dd0 that was originally added here
body: <p>I am getting this error : has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46029dd0 that was originally added here
  I have net connection in emulator, check it out browser by opening websites.</p>
  
  <p>I am getting error at the line of processdialog.</p>
  
  <pre><code>@SuppressLint("NewApi")
  private class TheTask extends AsyncTask&lt;Void, Void, Void&gt; {
  
      @Override
      protected void onPreExecute() {
          dialog = ProgressDialog.show(Register.this, "",
                  "Registering... Please wait...", true);
      }
  
      @Override
      protected Void doInBackground(Void... params) {
  
          request = new SoapObject(NAMESPACE, METHOD_NAME);
  
          name = new PropertyInfo();
          name.setName("Name");
          name.setValue(Name);
          name.setType(String.class);
          request.addProperty(name);
  
          SoapSerializationEnvelope envp = new SoapSerializationEnvelope(
                  SoapEnvelope.VER11);
          envp.dotNet = true;
          envp.setOutputSoapObject(request);
          HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
          try {
              androidHttpTransport.call(SOAP_ACTION, envp);
              SoapPrimitive response = (SoapPrimitive) envp.getResponse();
              Response = response.toString();
  
          } catch (Exception e) {
              textValidation.setText(e.toString());
          }
  
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
  
          if (dialog != null) {
              dialog.dismiss();
              dialog = null;
          }
          }
      }
  }
  </code></pre>