title: onCancelled() seems differnet in Ice Cream Sandwich
body: <p>Just wondered what's happened with IceCream Sandwich...</p>
  
  <p>I had a simple <code>AsyncTask</code> reading data from a server. When the <strong>Disconnect</strong> button was clicked, then <code>lServerTask.cancel(true);</code> was called which was successfully calling <code>onCancelled()</code>, setting <code>m_Running = false;</code> thus breaking out of the while loop in <code>protected void doInBackground(Void...params)</code>.</p>
  
  <p>With my Galaxy Nexus, I click the disconnect button, but the task does not quit. And is still connected to the server. Does anyone have any ideas?</p>
  
  <p>Many Thanks</p>
  
  <p>Mark</p>
  
  <p>Code FYI - </p>
  
  <pre><code>        // automatically done on worker thread (separate from UI thread)
      protected Void doInBackground(Void...params) 
      {
          while(m_Running)
          {
              try 
              {
                  lRDS.readSocket();
              } 
              catch (IOException e) 
              {
                  lRDS.disconnectFromServer();
                  publishProgress(e.toString());
                  return null;
              }
  
              lDataBuffer = lRDS.getDataBuffer();    
  
              publishProgress(lDataBuffer);
  
          }
          return null;
      }
  
      @Override
      protected void onCancelled() 
      {
          m_Running = false;
          connectRDSButton.setEnabled(true);
          disconnectRDSButton.setEnabled(false);
      }
  </code></pre>
  
  <p>and from the UI side:</p>
  
  <pre><code>private class disconnectRDSButtonHandler implements View.OnClickListener
  {        
      public void onClick(View v)
      {            
          editRobotData.setText("Disconnect...");
          if (lRobotDataServerTask.cancel(true) == true)
          {
              editRobotData.setText("Disconnected...");                
          }
      }        
  }
  </code></pre>