title: Get the ID of entered geofence
body: <p>I have made two geofences by adding the coordinates from a sqlite table. It does create the geofences on the map and transitions also do occur.</p>
  
  <p>My problem is that all the transitions trigger the same broadcast, this means no matter what two geofences I enter, it shows the same notification.</p>
  
  <p>How do I get location specific messages?</p>
  
  <p>I have used this line of code to get the triggered fence's ID and this works properly, but it also gives unwanted things such as the longitude, latitude and radius. How do I extract <strong>only</strong> the ID from this?</p>
  
  <pre><code>List&lt;Geofence&gt; ab = LocationClient.getTriggeringGeofences(intent);
  </code></pre>
  
  <p>This is the relevant part of the code.</p>
  
  <pre><code> @Override
          public void onConnected(Bundle arg0) {
  
              mClient.requestLocationUpdates(mRequest, this);
              SQLiteDatabase db = database.getWritableDatabase();
              String[] columns = {PromoDatabase.LID,PromoDatabase.lRestuarantID,PromoDatabase.lBranchID,PromoDatabase.Latitude,PromoDatabase.Longitude};
              Cursor cursor = db.query(PromoDatabase.LOCATION_TABLE, columns, null, null, null, null, null);
              String RestuarantName = null;
  
  
                  while(cursor.moveToNext())  //create the two geofences with with help of sqlite table
                  {
  
                      String LocationID  = cursor.getString(0);
                      String RestuarantID  = cursor.getString(1);
                      double latitude = cursor.getDouble(3); 
                      double longitude = cursor.getDouble(4); 
  
                      RestuarantName = getData(RestuarantID); //get the restuarant name by giving the RestuarantID
  
  
                      float radius = 800;
                      // Build a Geofence
                      Geofence fence = new Geofence.Builder()
                      .setRequestId(LocationID)
                      .setCircularRegion(latitude, longitude, radius)
                      .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER)
                      .setExpirationDuration(Geofence.NEVER_EXPIRE)
                      .build();
                      mList.add(fence);
  
                      googleMap.addMarker( new MarkerOptions()
                        .position( new LatLng(latitude, longitude) )
                        .title(RestuarantName+": Fence " + LocationID)
                        .snippet("Radius: " + radius) ).showInfoWindow();
  
  
                          circleOptions = new CircleOptions()
                            .center( new LatLng(latitude, longitude) )
                            .radius( radius )
                            .fillColor(0x40ff0000)
                            .strokeColor(Color.TRANSPARENT)
                            .strokeWidth(2);
                          googleMap.addCircle(circleOptions);
  
                  }
  
  
              // Method 2: Using Broadcast
              Intent intent = new Intent();
              intent.setAction(GeofenceEventReceiver.GEOFENCE_EVENTS); // Specify the action, a.k.a. receivers
              intent.addCategory(Intent.CATEGORY_DEFAULT);
              intent.putExtra("Location", "KFC");
              PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
              // Send out the Geofence request
  
              mClient.addGeofences(mList, pendingIntent, this);
  
          }
  
  
          // Broadcast receiver used to receive broadcast sent from the GeofenceIntentService
              public class GeofenceEventReceiver extends BroadcastReceiver {
                  public static final String GEOFENCE_EVENTS = "com.Drogo.proto.GeofenceEvents";
  
                      @Override
                      public void onReceive(Context context, Intent intent) {
                          String locationInfo = "Arraived at " + intent.getStringExtra("Location");
  
  
                          List&lt;Geofence&gt; BreachedGeofence = LocationClient.getTriggeringGeofences(intent); 
  
                          Toast.makeText(context, locationInfo + BreachedGeofence, Toast.LENGTH_LONG).show();
  
                          notifyMe(context,intent, locationInfo);   //this will basically give me a notification through the notification manager.
  
                      }
  </code></pre>