title: Android async task in service freezes UI
body: <p>I've got a service that is running an ASync task. 
  This task is causing my UI to freeze (even though it shouldn't).</p>
  
  <pre><code>public class StartMonitoringRegionsTask extends AsyncTask&lt;Void, Void, Void&gt; {
  
      @Override
          protected Void doInBackground(Void... params) {
              beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
                  @Override public void onServiceReady() {
                      try {
                          for(int i = 0; i &lt;= METRO_VEHICLE_REFERENCE_LIMIT; i++) {
                              beaconManager.startMonitoring(new Region("vehicle region", PROXIMITY_UUID, i, null));
                          }
                          for(int i = METRO_VEHICLE_REFERENCE_LIMIT+1; i &lt;= METRO_STOP_REFERENCE_LIMIT; i++) {
                              beaconManager.startMonitoring(new Region("stop region", PROXIMITY_UUID, i, null));
                          }
                          for(int i = METRO_STOP_REFERENCE_LIMIT+1; i &lt;= BUS_VEHICLE_REFERENCE_LIMIT; i++) {
                              beaconManager.startMonitoring(new Region("region", PROXIMITY_UUID, i, null));
                          }
                          for(int i = BUS_VEHICLE_REFERENCE_LIMIT+1; i &lt;= BUS_STOP_REFERENCE_LIMIT; i++) {
                              beaconManager.startMonitoring(new Region("stop region", PROXIMITY_UUID, i, null));
                          }
                      } catch (RemoteException e) {
                          Log.i("TAG", "Error while starting monitoring");
                      }
                  }
              });
          return null;
      }
  }
  </code></pre>
  
  <p>To start the task I call:</p>
  
  <pre><code>new StartMonitoringRegionsTask().execute(); 
  </code></pre>
  
  <p>Any suggestions?</p>