android - How to delay SurfaceView setup with CameraSource? -
i have 2 activities :
- a surfaceview receiving feed camerasource
- b simple form, filled info activity scan
i'd close activity on scan completion , animate activity b appearance. seems surfaceview or camerasource somehow blocking ui thread , preventing smooth transition.
activity :
... @override public void surfacedestroyed(surfaceholder holder) { mcamerasource.stop(); } ... @override public void receivedetections(detector.detections<barcode> detections) { if (misreadyfortransfer) { return; } sparsearray<barcode> barcodes = detections.getdetecteditems(); if (barcodes.size() == 0 || barcodes.valueat(0).displayvalue.equals(mlastresult)) { return; } mlastresult = barcodes.valueat(0).displayvalue; if (mlastresult.substring(0, 3).equals("xxx")) { misreadyfortransfer = true; transferactivity.start(this, scanresult.getresultfromscan(mlastresult)); finish(); } }
thanks time.
Comments
Post a Comment