public void start() { listener = new ProximityListener(); lastProximityInfo = new ProximityInfo(); if (Sensor_Proximity.isAvailable()) { proximityAvailable = true; } else { proximityAvailable = false; } Sensor_Proximity.addListener(listener, period); super.start(); }
void stop(StopCode stopCode) { Sensor_Proximity.removeListener(listener); super.stop(stopCode); }