Code example for ActivityRecognitionClient

Methods: requestActivityUpdates

0
 
    @Override 
    public void onConnected(Bundle bundle) {
        Intent intent = new Intent(this, ActivityIntentService.class);
        PendingIntent callbackIntent = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
        mClient.requestActivityUpdates(300000, callbackIntent);
    } 
 
    @Override 
    public void onDisconnected() { 
 
    } 
 
    @Override 
    public void onConnectionFailed(ConnectionResult connectionResult) {
 
    } 
 
    @Override 
    public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
        long current = System.currentTimeMillis();