diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java index 99c2cb17..8006d095 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java @@ -22,7 +22,7 @@ class OrientationHelper { OrientationHelper(Context context, @NonNull Callback callback) { mCallback = callback; - mListener = new OrientationEventListener(context, SensorManager.SENSOR_DELAY_NORMAL) { + mListener = new OrientationEventListener(context.getApplicationContext(), SensorManager.SENSOR_DELAY_NORMAL) { @Override public void onOrientationChanged(int orientation) { @@ -72,4 +72,4 @@ class OrientationHelper { int getDisplayOffset() { return mDisplayOffset; } -} \ No newline at end of file +}