Code example for LocationClient

Methods: addGeofences

0
        // Get a PendingIntent that Location Services issues when a geofence transition occurs 
        mGeofencePendingIntent = createRequestPendingIntent();
 
        // Send a request to add the current geofences 
        try { 
            mLocationClient.addGeofences(mCurrentGeofences, mGeofencePendingIntent, this);
        } catch (IllegalArgumentException e) {
            Log.e("Geofence", "Oh no! They are empty!");
            requestDisconnection(); 
        } 
    } 
 
    /* 
     * Handle the result of adding the geofences 
     */ 
    @Override 
    public void onAddGeofencesResult(int statusCode, String[] geofenceRequestIds) {
 
        // Create a broadcast Intent that notifies other components of success or failure 
        Intent broadcastIntent = new Intent();