title: Android: onReceiveResult is not triggered
body: <p>I'm trying to get some data from a <code>Service</code> that gets an address from coordinates. I followed the step by step official android tutorial about this (<a href="http://developer.android.com/training/location" rel="nofollow noreferrer">http://developer.android.com/training/location</a>) but i'm stuck. I'm sending the data from the <code>Service</code> class to the <code>Activity</code> using the <code>send</code> method but the <code>onReceiveResult</code> method doesn't seem to trigger. Here's my <code>Service</code> class:</p>
  
  <pre><code>public class FetchAddressIntentService extends IntentService {
  
      protected ResultReceiver mReceiver;
  
      public FetchAddressIntentService(String name) {
          super(name);
      }
  
      public FetchAddressIntentService() {
          super("FetchAddressIntentService");
      }
  
      @Override
      protected void onHandleIntent(Intent intent) {
          Geocoder geocoder = new Geocoder(this, Locale.getDefault());
          String errorMessage = "";
  
          // Get the location passed to this service through an extra.
          Location location = intent.getParcelableExtra(Constants.LOCATION_DATA_EXTRA);
          mReceiver = new ResultReceiver(new Handler());
          List &lt; Address &gt; addresses = null;
  
          try {
              addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); //we want 1 result
          } catch (IOException ioException) {
              errorMessage = getString(R.string.service_not_available);
              Log.e("TAG", errorMessage, ioException);
          } catch (IllegalArgumentException illegalArgumentException) {
              errorMessage = getString(R.string.invalid_lat_long_used);
              Log.e("TAG", errorMessage + ". " + "Latitude = " + location.getLatitude() + ", Longitude = " + location.getLongitude(), illegalArgumentException);
          }
  
          if (addresses == null || addresses.size() == 0) {
              if (errorMessage.isEmpty()) {
                  errorMessage = getString(R.string.no_address_found);
                  Log.e("TAG", errorMessage);
              }
              deliverResultToReceiver(Constants.FAILURE_RESULT, errorMessage);
          } else {
              Address address = addresses.get(0);
              ArrayList &lt; String &gt; addressFragments = new ArrayList &lt; String &gt; ();
  
              for (int i = 0; i &lt; address.getMaxAddressLineIndex(); i++) {
                  addressFragments.add(address.getAddressLine(i));
              }
              Log.i("TAG", getString(R.string.address_found) + ": " + addressFragments.get(0));
              deliverResultToReceiver(Constants.SUCCESS_RESULT, TextUtils.join(System.getProperty("line.separator"), addressFragments));
          }
      }
  
      private void deliverResultToReceiver(int resultCode, String message) {
          Bundle bundle = new Bundle();
          bundle.putString(Constants.RESULT_DATA_KEY, message);
          mReceiver.send(resultCode, bundle);
      }
  }
  </code></pre>
  
  <p>And the relevant part of my <code>Activity</code>:</p>
  
  <pre><code>class AddressResultReceiver extends ResultReceiver {
      public AddressResultReceiver(Handler handler) {
          super(handler);
      }
  
      @Override
      protected void onReceiveResult(int resultCode, Bundle resultData) {
  
          mAddressOutput = resultData.getString(Constants.RESULT_DATA_KEY);
          Log.i("address", mAddressOutput);
          address.setText(mAddressOutput);
  
          if (resultCode == Constants.SUCCESS_RESULT) {
              Toast.makeText(LocationActivity.this, getString(R.string.address_found),
                      Toast.LENGTH_LONG).show();
          }
      }
  }
  </code></pre>