Skip to content

Commit

Permalink
use the application context not the activity context
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Jul 3, 2018
1 parent b20c175 commit f91a6f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/havenapp/main/ui/CameraFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ private void initCamera ()
//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);

Expand All @@ -99,6 +100,7 @@ private void initCamera ()
@Override
public void onDestroy() {
super.onDestroy();

}

public void onSensorChanged(SensorEvent event) {
Expand Down

0 comments on commit f91a6f4

Please sign in to comment.