Building onReceive()

Received a Context and an Intent
ArrayList
getParcelableArrayListExtra()
Iterate throught ArrayList
– getType() -DetectedActivity code
– getConfidence()

Setting up the Client
onStart()/ onStop()
onPause()
Get LocalBroadcastManager and Unregister our receiver
onResume()
Get LocalBroadcastManager and register our receiver
Use same IntentFilter name(BROADCAST_ACTION)

@Override
protected void onStart(){
	super.onStart();
	mGoogleApiClient.connect();
}

@Override
protected void onStop(){
	super.onStop();
	mGoogleApiClient.disconnect();
}

Implementing Buttons
requestActivityUpdatesButtonHandler
.requestActivityUpdates()
The API Client, Interval in ms
A Pending Intent – getActivityDetectionPendingIntent()
removeActivityUpdatesHandler
.removeActivityUpdates()
API Client & Pending Intent