Loading app/src/main/java/net/sourceforge/opencamera/MainActivity.java +18 −11 Original line number Diff line number Diff line Loading @@ -466,7 +466,9 @@ public class MainActivity extends AppCompatActivity { // initialise state of on-screen icons mainUI.updateOnScreenIcons(); // listen for orientation event change if( MainActivity.lock_to_landscape ) { // listen for orientation event change (only required if lock_to_landscape==true // (MainUI.onOrientationChanged() does nothing if lock_to_landscape==false) orientationEventListener = new OrientationEventListener(this) { @Override public void onOrientationChanged(int orientation) { Loading @@ -475,6 +477,7 @@ public class MainActivity extends AppCompatActivity { }; if( MyDebug.LOG ) Log.d(TAG, "onCreate: time after setting orientation event listener: " + (System.currentTimeMillis() - debug_time)); } layoutChangeListener = new View.OnLayoutChangeListener() { @Override Loading Loading @@ -1466,7 +1469,9 @@ public class MainActivity extends AppCompatActivity { mSensorManager.registerListener(accelerometerListener, mSensorAccelerometer, SensorManager.SENSOR_DELAY_NORMAL); magneticSensor.registerMagneticListener(mSensorManager); if( orientationEventListener != null ) { orientationEventListener.enable(); } getWindow().getDecorView().addOnLayoutChangeListener(layoutChangeListener); // if BLE remote control is enabled, then start the background BLE service Loading Loading @@ -1600,7 +1605,9 @@ public class MainActivity extends AppCompatActivity { unregisterDisplayListener(); mSensorManager.unregisterListener(accelerometerListener); magneticSensor.unregisterMagneticListener(mSensorManager); if( orientationEventListener != null ) { orientationEventListener.disable(); } getWindow().getDecorView().removeOnLayoutChangeListener(layoutChangeListener); bluetoothRemoteControl.stopRemoteControl(); freeAudioListener(false); Loading Loading
app/src/main/java/net/sourceforge/opencamera/MainActivity.java +18 −11 Original line number Diff line number Diff line Loading @@ -466,7 +466,9 @@ public class MainActivity extends AppCompatActivity { // initialise state of on-screen icons mainUI.updateOnScreenIcons(); // listen for orientation event change if( MainActivity.lock_to_landscape ) { // listen for orientation event change (only required if lock_to_landscape==true // (MainUI.onOrientationChanged() does nothing if lock_to_landscape==false) orientationEventListener = new OrientationEventListener(this) { @Override public void onOrientationChanged(int orientation) { Loading @@ -475,6 +477,7 @@ public class MainActivity extends AppCompatActivity { }; if( MyDebug.LOG ) Log.d(TAG, "onCreate: time after setting orientation event listener: " + (System.currentTimeMillis() - debug_time)); } layoutChangeListener = new View.OnLayoutChangeListener() { @Override Loading Loading @@ -1466,7 +1469,9 @@ public class MainActivity extends AppCompatActivity { mSensorManager.registerListener(accelerometerListener, mSensorAccelerometer, SensorManager.SENSOR_DELAY_NORMAL); magneticSensor.registerMagneticListener(mSensorManager); if( orientationEventListener != null ) { orientationEventListener.enable(); } getWindow().getDecorView().addOnLayoutChangeListener(layoutChangeListener); // if BLE remote control is enabled, then start the background BLE service Loading Loading @@ -1600,7 +1605,9 @@ public class MainActivity extends AppCompatActivity { unregisterDisplayListener(); mSensorManager.unregisterListener(accelerometerListener); magneticSensor.unregisterMagneticListener(mSensorManager); if( orientationEventListener != null ) { orientationEventListener.disable(); } getWindow().getDecorView().removeOnLayoutChangeListener(layoutChangeListener); bluetoothRemoteControl.stopRemoteControl(); freeAudioListener(false); Loading