Skip to content

armgit / haven

Public Imported from GitHub
0

Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors

use the application context not the activity context

n8fr8f91a6f4b84ad
diff --git a/src/main/java/org/havenapp/main/ui/CameraFragment.java b/src/main/java/org/havenapp/main/ui/CameraFragment.java
index 1868d24..43c4229 100644
--- a/src/main/java/org/havenapp/main/ui/CameraFragment.java
+++ b/src/main/java/org/havenapp/main/ui/CameraFragment.java
@@ -84,7 +84,8 @@ public final class CameraFragment extends Fragment {
//Uncomment to see the camera
CameraView cameraView = getActivity().findViewById(R.id.camera_view);
- cameraViewHolder = new Preview(getActivity(),cameraView);
+
+ cameraViewHolder = new Preview(getContext().getApplicationContext(),cameraView);
newImage = getActivity().findViewById(R.id.new_image);
@@ -99,6 +100,7 @@ public final class CameraFragment extends Fragment {
@Override
public void onDestroy() {
super.onDestroy();
+
}
public void onSensorChanged(SensorEvent event) {