I am listening to DetectedActivity
, FusedLocation
, GoogleFit
etc. updates using a pending intent
. I pass over
PendingIntent.FLAG_UPDATE_CURRENT when calling: pendingIntent = PendingIntent.getService(this, 12, intentService, PendingIntent.FLAG_UPDATE_CURRENT);
However, I still get duplicate data.
I tried using a different request id for every time I listen to certain updates (different request id for listening to FusedLocation updates, different request id for listening to GoogleFit updates etc.) but it still gives me duplicate data. I also tried adding different actionIds to the intentService
Inside my Service, I have the following code:
intentService = new Intent(this, SensorsIntentService.class); //in onCreate
pendingIntent = PendingIntent.getService(this, 12, intentService, PendingIntent.FLAG_UPDATE_CURRENT);
I expect only one set of data every time and no duplicates. Any help would be appreciated.