DontDisplayMyName
DontDisplayMyName

Reputation: 279

GeofencingEvent.fromIntent(Intent) returns null

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?

Upvotes: 9

Views: 1028

Answers (1)

DontDisplayMyName
DontDisplayMyName

Reputation: 279

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...

Upvotes: 15

Related Questions