Example usage for com.facebook.react.bridge ReactContext getSystemService

List of usage examples for com.facebook.react.bridge ReactContext getSystemService

Introduction

In this page you can find the example usage for com.facebook.react.bridge ReactContext getSystemService.

Prototype

@Override
    public Object getSystemService(String name) 

Source Link

Usage

From source file:com.reactnative.googlefit.StepSensor.java

License:Open Source License

public StepSensor(ReactContext reactContext, Activity activity) {
    this.mReactContext = reactContext;
    this.activity = activity;

    boolean stepCounter = hasStepCounter();
    Log.i(TAG, "hasStepCounter: " + stepCounter);

    if (stepCounter) {
        mSensorManager = (SensorManager) reactContext.getSystemService(reactContext.SENSOR_SERVICE);
    }//from w w w .  ja  v a2  s . c o m
}