I'm trying to follow this guide to add a DataUpdateListener
to listen for DataType.TYPE_WEIGHT
events like so:
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,
new Intent(this, FitnessStoreUpdatesReceiver.class), PendingIntent.FLAG_UPDATE_CURRENT);
Fitness.HistoryApi.registerDataUpdateListener(googleApiClient,
new DataUpdateListenerRegistrationRequest.Builder()
.setDataType(DataType.TYPE_WEIGHT)
.setPendingIntent(pendingIntent)
.build());
My FitnessStoreUpdatesReceiver
is identical to the one linked in the guide. However, adding a weight event through the Google Fit Android app does not trigger my listener. Have I missed something in my implementation?