@Override protected void onPause() { super.onPause(); mView.onPause(); mSensorManager.unregisterListener(this); GodotLib.focusout(); }
public void onDestroy() { running = false; if (scanThread != null) scanThread.interrupt(); if (myWLocate != null) myWLocate.doPause(); sensorManager.unregisterListener( this, sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER)); if (scanData.getmView() != null) { ((WindowManager) getSystemService(WINDOW_SERVICE)).removeView(scanData.getmView()); scanData.setmView(null); } try { if (wl != null) wl.release(); } catch (RuntimeException re) { } wl = null; try { scanThread.join(1000); } catch (InterruptedException ie) { } System.exit(0); }
// Sensor events public void enableSensor(int sensortype, boolean enabled) { // TODO: This uses getDefaultSensor - what if we have >1 accels? if (enabled) { mSensorManager.registerListener( this, mSensorManager.getDefaultSensor(sensortype), SensorManager.SENSOR_DELAY_GAME, null); } else { mSensorManager.unregisterListener(this, mSensorManager.getDefaultSensor(sensortype)); } }
@Override protected void onPause() { super.onPause(); if (!godot_initialized) { if (null != mDownloaderClientStub) { mDownloaderClientStub.disconnect(this); } return; } mView.onPause(); mSensorManager.unregisterListener(this); GodotLib.focusout(); for (int i = 0; i < singleton_count; i++) { singletons[i].onMainPause(); } }