title: AsyncTask - onPostExecute is not called
body: <p>I'm working on one project and I need to call one <code>AsyncTask</code>, but the <code>onPostExecute</code> method is not called. </p>
  
  <p>This is my class:</p>
  
  <pre><code>public class WebService extends AsyncTask&lt;String, String, String&gt; {
      private ArrayList&lt;SimpleObserver&gt; listeners;
      private int responseCode;
      private String message;
      private String response;
      private String URL;
  
      public WebService() {
          listeners = new ArrayList&lt;SimpleObserver&gt;();
      }
  
      public void addListener(SimpleObserver obs) {
          listeners.add(obs);
      }
  
      public void removeListener(SimpleObserver obs) {
          listeners.remove(obs);
      }
  
      public void notifyListener(String s) {
          for (SimpleObserver listener : listeners)
              listener.onChange(s);
      }
  
      public String getResponse() {
          return response;
      }
  
      public String getErrorMessage() {
          return message;
      }
  
      public int getResponseCode() {
          return responseCode;
      }
  
      @Override
      protected void onPreExecute() {
          //notifyListener("A calcular");
      }
  
      @Override
      protected String doInBackground(String... urls) {
          String response = "";
          for (String url : urls) {
              HttpParams my_httpParams = new BasicHttpParams(); 
              final String proxyHost = android.net.Proxy.getDefaultHost();
              final int proxyPort = android.net.Proxy.getDefaultPort();
              if(proxyPort != -1)
              {
                my_httpParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxyHost, proxyPort));            
              }
  
              DefaultHttpClient client = new DefaultHttpClient(my_httpParams);
              HttpGet httpGet = new HttpGet(url);
              Log.d("URL serviço HttpGet", url);
              try {
                  HttpResponse execute = client.execute(httpGet);
                  InputStream content = execute.getEntity().getContent();
  
                  BufferedReader buffer = new BufferedReader(
                          new InputStreamReader(content));
                  String s = "";
                  while ((s = buffer.readLine()) != null) {
                      response += s;
                  }
  
                  Log.d("RESPOSTA do web service", response);
  
              } catch (Exception e) {
                  e.printStackTrace();
                  response = e.getMessage();
                  Log.e("ERRO de respota", e.getMessage());
              }
          }
          return response;
      }
  
      @Override
      protected void onPostExecute(String result) {
          Log.d("onPostExecute Serviço", result);
          notifyListener(result);
      }
  }
  </code></pre>
  
  <p>I have created this method:</p>
  
  <pre><code>public void executeService(String param) {
          try {
              Log.d("Entrar", "no serviço");
              s.execute(new String [] {URL+param});
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
              Log.e("Erro ao aceder ao web service", e.getMessage());
          }
      }
  </code></pre>
  
  <p>to call the task. </p>
  
  <p>these are the results of Log</p>
  
  <pre><code>08-28 17:47:21.936: D/URL serviço HttpGet(2055): http://192.168.56.1:8080/pt.Agile21.Acerola.WebService/rest/acerola?id=g;ana@eu.com
  08-28 17:47:22.456: D/RESPOSTA do web service(2055): ana;ana@eu.com;pass;0
  08-28 17:47:22.456: D/RESPOSTA do web service(2055): ana;ana@eu.com;pass;0
  </code></pre>
  
  <p>As you can see I have all the results of doInBackground(). :S</p>
  
  <p>Someone can help me to understand which is the problem?</p>
  
  <p>Something that I saw now looking for the Log files.. my onPostExeute method returns when I finish my app on purpose.. it is not normal.. :S can someone help me?</p>