GeofencingEvent.fromIntent(Intent) returns null
Asked Answered
A

1

7

I followed this tutorial using Java. As expected the BroadcastReceiver receives an Intent, but the GeofencingEvent fromIntent (Intent intent) method returns NULL. According to the docs for fromIntent:

returns - a GeofencingEvent object or null if the given intent is null or doesn't contain geofencing event

What are possible reasons?

Arrearage answered 23/10, 2022 at 20:47 Comment(0)
A
12

While i wrote this question i noticed the error: In newer versions PendingIntent.getBroadcast forces you to choose either PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_UNMUTABLE. I chose FLAG_UNMUTABLE... Obviously the Intent cant get filled with GeofenceEvent Information if its not mutable...

Arrearage answered 23/10, 2022 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.