我想从接近传感器获得实际接近度,但默认行为是注册一个侦听器并等待值更改。我不想等待改变,但我想获得实际价值。那可能吗?
mSensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
mProximity = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
mSensorManager.registerListener(this, mProximity, 0);