我想提高 Android Proximity Sensor 的灵敏度级别,以便它可以从远距离触发。当前它在物体太靠近 1.5 英寸时起作用,我想增加 3 到 4 英寸。有可能的?
private SensorManager mSensorManager;
private Sensor mProximity;
private static final int SENSOR_SENSITIVITY = 8;
public int count=0;
@Override
public void onSensorChanged(SensorEvent event) {
TextView tv = (TextView)findViewById(R.id.textView);
if (event.sensor.getType() == Sensor.TYPE_PROXIMITY) {
if (event.values[0] < SENSOR_SENSITIVITY) {
count++;
tv.setText("Count:"+count);
}
}
}
here you can see!
**private static final int SENSOR_SENSITIVITY = 8;**
i am using sensor sensitivity =8 but when is increase to 20 nothing change