Question: I'm able to successfully integrate barcode scanner using zxing library to make a standalone scanner. The problem that is coming in my application is the **autofocus**. Camera in my app is taking the initial focus and is not resetting. for eg. if initially I point my camera to dark surface and then I focus it to the page having the barcode, the text on the page is not even visible. the contrast is too high. and this contrast is not resetting like in barcode scanner app by zxing.

I have seen other apps like pvr cinemas which are using zxing library and on my device they are working fine in regards to this issue. Their focus is getting reset.

I have followed this [tutorial](http://phpmyweb.net/2012/07/18/integrating-zxing-in-your-android-app-as-standalone-scanner/)

Answer: 
I had commented out the part

```
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);

```

Thanks for pointing out `AutofocusManager` I added

```
if (Build.VERSION.SDK_INT >= 11 ) {
                         // changed to 11 as Build.VERSION_CODES.HONEYCOMB is not
                         // accessible on android platform prior to 3.0
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
} else {
    task.execute(args);
}

```

in `HoneycombAsyncTaskExecInterface`

Now its working fine. Thanks @[Sean Owen](https://stackoverflow.com/users/64174/sean-owen)
You probably modified the scan-focus loop and caused it to stop working. Look at how `AutofocusManager` triggers focus, waits for the preview frame, and then is triggered again. You need to debug this part to see what you changed.