Heart Rate Sensor not found (LG Watch Urbane)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to access to the heart rate sensor of my LG Watch Urbane using this code on MainActivity.java: mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); mHeartRateSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE); boolean sensorRegistered = mSensorManager.registerListener(this, mHeartRateSensor, SensorManager.SENSOR_DELAY_NORMAL); Log.d("Sensor Status:", " Sensor registered: " + (sensorRegistered ? "yes" : "no")); The problem is that I get this error: E/SensorManager: sensor or listener is null That