Code example for ActivityRecognitionClient

Methods: requestActivityUpdates

0
    public void onConnected(Bundle bundle) {
        Intent intent = new Intent(this, RecognitionIntentService.class);
        mPendingIntent = PendingIntent.getService(this, 0, intent,
                PendingIntent.FLAG_UPDATE_CURRENT);
 
        mClient.requestActivityUpdates(20 * 1000, mPendingIntent);
    } 
 
    @Override 
    public void onDisconnected() { 
        mClient = null;
    } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE