GeofencingRequest.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
Adds a geofence to the request.
Adds the given geofences to the request.
Parameters
initialTrigger |
the notification behavior. Should be a bit-wise of
GeofencingRequest#INITIAL_TRIGGER_ options. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eGeofencingRequest.Builder\u003c/code\u003e is used to construct \u003ccode\u003eGeofencingRequest\u003c/code\u003e objects for geofencing operations.\u003c/p\u003e\n"],["\u003cp\u003eYou can add individual or multiple geofences to the request using \u003ccode\u003eaddGeofence\u003c/code\u003e and \u003ccode\u003eaddGeofences\u003c/code\u003e methods respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esetInitialTrigger\u003c/code\u003e method configures the initial geofence notification behavior when geofences are added.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild\u003c/code\u003e method finalizes the request and returns a \u003ccode\u003eGeofencingRequest\u003c/code\u003e instance, requiring at least one geofence to have been added beforehand.\u003c/p\u003e\n"]]],[],null,["# GeofencingRequest.Builder\n\npublic static final class **GeofencingRequest.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nA builder for [GeofencingRequest](/android/reference/com/google/android/gms/location/GeofencingRequest). \n\n### Public Constructor Summary\n\n|---|-----------------------------------------------------------------------------------------------------|\n| | [Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder#Builder())() |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GeofencingRequest.Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder) | [addGeofence](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder#addGeofence(com.google.android.gms.location.Geofence))([Geofence](/android/reference/com/google/android/gms/location/Geofence) geofence) Adds a geofence to the request. |\n| [GeofencingRequest.Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder) | [addGeofences](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder#addGeofences(java.util.List\u003c?%20extends%20com.google.android.gms.location.Geofence\u003e))([List](//developer.android.com/reference/java/util/List.html)\\\u003c? extends [Geofence](/android/reference/com/google/android/gms/location/Geofence)\\\u003e geofences) Adds the given geofences to the request. |\n| [GeofencingRequest](/android/reference/com/google/android/gms/location/GeofencingRequest) | [build](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder#build())() Builds the [GeofencingRequest](/android/reference/com/google/android/gms/location/GeofencingRequest). |\n| [GeofencingRequest.Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder) | [setInitialTrigger](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder#setInitialTrigger(int))(int initialTrigger) Sets the geofence notification behavior at the moment when the geofences are added. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **Builder** ()\n\nPublic Methods\n--------------\n\n#### public [GeofencingRequest.Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder)\n**addGeofence** ([Geofence](/android/reference/com/google/android/gms/location/Geofence) geofence)\n\nAdds a geofence to the request. \n\n#### public [GeofencingRequest.Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder)\n**addGeofences** ([List](//developer.android.com/reference/java/util/List.html)\\\u003c? extends [Geofence](/android/reference/com/google/android/gms/location/Geofence)\\\u003e geofences)\n\nAdds the given geofences to the request. \n\n#### public [GeofencingRequest](/android/reference/com/google/android/gms/location/GeofencingRequest)\n**build** ()\n\nBuilds the [GeofencingRequest](/android/reference/com/google/android/gms/location/GeofencingRequest).\nAt least one geofence must have been added to the [GeofencingRequest.Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder). \n\n#### public [GeofencingRequest.Builder](/android/reference/com/google/android/gms/location/GeofencingRequest.Builder)\n**setInitialTrigger** (int initialTrigger)\n\nSets the geofence notification behavior at the moment when the geofences are added.\nThe default behavior is [GeofencingRequest.INITIAL_TRIGGER_ENTER](/android/reference/com/google/android/gms/location/GeofencingRequest#INITIAL_TRIGGER_ENTER) and [GeofencingRequest.INITIAL_TRIGGER_DWELL](/android/reference/com/google/android/gms/location/GeofencingRequest#INITIAL_TRIGGER_DWELL). \n\n##### Parameters\n\n| initialTrigger | the notification behavior. Should be a bit-wise of `GeofencingRequest#INITIAL_TRIGGER_` options. |\n|----------------|--------------------------------------------------------------------------------------------------|"]]