Exemplo n.º 1
0
 @Override
 protected void onPause() {
   super.onPause();
   if (handler != null) {
     handler.quitSynchronously();
     handler = null;
   }
   CameraManager.get().closeDriver();
 }
Exemplo n.º 2
0
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_qx_reader);
   CameraManager.init(getApplication());
   viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
   txtResult = (TextView) findViewById(R.id.txtResult);
   hasSurface = false;
   inactivityTimer = new InactivityTimer(this);
 }
Exemplo n.º 3
0
 private void initCamera(SurfaceHolder surfaceHolder) {
   try {
     CameraManager.get().openDriver(surfaceHolder);
   } catch (IOException ioe) {
     return;
   } catch (RuntimeException e) {
     return;
   }
   if (handler == null) {
     handler = new CaptureActivityHandler(this, decodeFormats, characterSet);
   }
 }