Comments (1)
-public class Geofencing implements ResultCallback {
+public class Geofencing implements OnSuccessListener, OnFailureListener {
+ private GeofencingClient geofencingClient;
//onCreate()
+ geofencingClient = LocationServices.getGeofencingClient(mContext);
//registerAllGeofences()
- LocationServices.GeofencingApi.addGeofences(
- mGoogleApiClient,
- getGeofencingRequest(),
- getGeofencePendingIntent()
- ).setResultCallback(this);
+ geofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
+ .addOnSuccessListener(this)
+ .addOnFailureListener(this);
//unRegisterAllGeofences()
- LocationServices.GeofencingApi.removeGeofences(
- mGoogleApiClient,
+ geofencingClient.removeGeofences(
- ).setResultCallback(this);
+ ).addOnSuccessListener(this)
+ .addOnFailureListener(this)
+ ;
- public void updateGeofencesList(PlaceBuffer places) {
+ public void updateGeofencesList(List<Place> places) {
- if (places == null || places.getCount() == 0) return;
+ if (places == null || places.size() == 0) return;
- public void onResult(@NonNull Result result) {
- Log.e(TAG, String.format("Error adding/removing geofence : %s",
- result.getStatus().toString()));
+ public void onFailure(@NonNull Exception e) {
+ Log.d(TAG, "onFailure: Geofence add failure");
+ @Override
+ public void onSuccess(Object o) {
+ Log.d(TAG, "onSuccess: Geofence adeed");
+ }
from advancedandroid_shushme.
Related Issues (17)
- Not able to add location because the activity closes with resultCode = 2 HOT 7
- Manifest permission missing. HOT 3
- Recycler view swipe to delete location HOT 5
- Ringer mode issues HOT 3
- PlaceBuffer must be released after use. HOT 5
- Does this app run HOT 2
- Updated Gradle & Dependencies
- Places Api Deprecated HOT 2
- getting OVER_QUERY_LIMIT regularly. And search showing only cities.
- i just applied this solution but the recyclerView shows nothing on the Mainactivtiy screen. the location i in DB but it is not shown on the screen HOT 3
- Cloning error
- places aren't getting search HOT 2
- Steps to Upgrade Gradle Version and Plugin to Your Latest Android Studio
- MAP ISN'T SHOWING || PlacePicker deprecated!!
- The map is not loading properly on pressing the Add new location button HOT 14
- place.getAddress().toString on a Null Pointer Reference HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advancedandroid_shushme.