I'm trying to write a service that get the heart rate on Gear Live, following the question here Get Heart Rate from "Sensor" Samsung Gear Live
If I put this part
Log.d(TAG, "prepare to call getSystemService");
mSensorManager = ((SensorManager)getSystemService(SENSOR_SERVICE));
Log.d(TAG, "after calling getSystemService");
at onCreate()
of an activity, it works fine. But if I move that to a Service, it throws a NPE. I tried to add this.
in front of `getSystemService, doesn't help. Any tip, thanks