コード例 #1
0
 @Override
 public void onPause() {
   super.onPause();
   try {
     cameraView.stopCamera();
     stopAutofocus();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
コード例 #2
0
 private void startAutofocus() {
   if (isHaveAutoFocus()) {
     autoFocusHandler.postDelayed(runAutoFocus, AUTOFOCUS_REFRESH_DELAY);
     cameraView.getCamera().autoFocus(autoFocusCallback);
   }
 }
コード例 #3
0
 private void stopAutofocus() {
   if (isHaveAutoFocus() && cameraView.getCamera() != null) {
     autoFocusHandler.removeCallbacks(runAutoFocus);
     cameraView.getCamera().cancelAutoFocus();
   }
 }