title: Android creating geofence
body: <p>I am working on geofence api launched in Google I/O 2013. <a href="http://developer.android.com/training/location/geofencing.html" rel="nofollow">Creating and Monitoring Geofences</a></p>
  
  <p>There is a method in the example given in the above link as follows: </p>
  
  <pre><code> public void createGeofences() {
      ........
      mGeofenceList.add(mUIGeofence1.toGeofence());
      mGeofenceList.add(mUIGeofence2.toGeofence());
  }
  </code></pre>
  
  <p>This method is inside onActivityResult of my activity and in the same activity i have button to save geofence and to call mLocationClient.connect() -> it's same as addGeofences() method of the example. </p>
  
  <pre><code>@Override
  private void onConnected(Bundle dataBundle) {
      ...
      switch (mRequestType) {
          case ADD :
              // Get the PendingIntent for the request
              mTransitionPendingIntent =
                      getTransitionPendingIntent();
              // Send a request to add the current geofences
              mLocationClient.addGeofences(
                      mGeofenceList, pendingIntent, this);
          ...
      }
  }
  </code></pre>
  
  <p>In this method mGeofenceList is empty which should not be since it has been updated in onActivityResult method before. </p>
  
  <p><strong>Problem:</strong> the variable mGeofenceList is updated in onActivityResult but when accessed in onConnected method it is empty. Where am I wrong? Please help.</p>