From 8dbd14dd6b4999a8807ba172597604c2f4ae98f7 Mon Sep 17 00:00:00 2001 From: Fahad Ahmed Khan Date: Fri, 16 Jun 2017 22:27:07 +0500 Subject: [PATCH] The PendingIntent service wasn't being stored. I found this through the tutsplus tutorial. The code wasn't working (the IntentService was not being created). Found the error. Fixed it. --- app/src/main/java/com/tinmegali/mylocation/MainActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/tinmegali/mylocation/MainActivity.java b/app/src/main/java/com/tinmegali/mylocation/MainActivity.java index 4a61895..63d9bf2 100644 --- a/app/src/main/java/com/tinmegali/mylocation/MainActivity.java +++ b/app/src/main/java/com/tinmegali/mylocation/MainActivity.java @@ -364,8 +364,9 @@ private PendingIntent createGeofencePendingIntent() { return geoFencePendingIntent; Intent intent = new Intent( this, GeofenceTrasitionService.class); - return PendingIntent.getService( + geoFencePendingIntent = PendingIntent.getService( this, GEOFENCE_REQ_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT ); + return geoFencePendingIntent; } // Add the created GeofenceRequest to the device's monitoring list