Fix updating layout from wrong thread (#1)

pull/2/head
shtolik 7 years ago committed by Mattia Iavarone
parent b4eeb2368c
commit 400ade252f
  1. 7
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java

@ -1215,7 +1215,12 @@ public class CameraView extends FrameLayout {
// Request a layout pass for onMeasure() to do its stuff.
// Potentially this will change CameraView size, which changes Surface size,
// which triggers a new Preview size. But hopefully it will converge.
requestLayout();
uiHandler.post(new Runnable() {
@Override
public void run() {
requestLayout();
}
});
}

Loading…
Cancel
Save