0

after carefully following this answer: How to integrate Zxing Barcode Scanner without installing the actual zxing app (cannot resolve symbol: .android.CaptureActivity)? by Liran Cohen

the scanner should not be opened in a separate activity (called via intent), it should be shown just below a button (like logout).

I was able to detect/scan and get the decoded string of the barcode but the problem is the red line is missing, how to make the red line appear?

I extended the captureActivity to a activity I am using like readerActivity and override the handleDecode function to detect/scan and decode the qr image.

just want to know how to show the red line.

also tried changing the following code in the viewfinderview but still not working:

 int middle = frame.width() /2 + frame.left;

under the onDraw() function

also tried calling the function:

 viewfinderView.setWillNotDraw(false);

in the oncreate function of the captureActivity, the red line is still hidden.

Community
  • 1
  • 1
vims liu
  • 643
  • 1
  • 9
  • 20

1 Answers1

1

You can take the code of Zxing on GitHub and add it to your project.

Look at these activity CaptureActivity for adding similar code to your activity.

J. Doe
  • 21
  • 4