Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is is possible to open scanner on fragment, not Activity? #252

Closed
chanisrunnin opened this issue Dec 14, 2016 · 3 comments
Closed

Is is possible to open scanner on fragment, not Activity? #252

chanisrunnin opened this issue Dec 14, 2016 · 3 comments

Comments

@chanisrunnin
Copy link

chanisrunnin commented Dec 14, 2016

Description of the problem:

Nice to meet you, I'm Lee Chan from south korea.
Now I'm making App for Barcode Scanner using your wonderful library, thank you very much.

I imported this library's source as a module in our app.
But there are some difficulties when adapting this 'zxing_android_embedded'.

Our app has designed as "One Activity - Many Fragment" structure for many reason.
But this library works on a Activity base,
That's the difficulty i had...
First, I have to call scanner at fragment,
and Second, the called scanner screen has to be a fragment.

Calling CaptureActivity in a fragment has successfully working as you mentioned at other issues,
but i can't find second question anywhere.

Is it possible to change CaptureActivity to Fragment base?

i'm trying but i stucked at when making under codes.

IntentIntegrator.forFragment(this)
.setCaptureActivity(xxxActivity.class) <-- this one.
.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES)
.setCameraId(0)
.setBeepEnabled(false)
.setBarcodeImageEnabled(true)
.initiateScan();

If i want to change Activity to Fragment,
then i think i need to modify IntentIntegrator, CaptureManager and so on..
but this way is not easy and can make side effect because i didn't fully understanding this library.

Also, inflate view which has merge tag was impossible, they need to be modify..

Is it possible?
If possible then Could you give me some idea or possible way to make CaptureActivity as a Fragment?

Thank you.

Which library version are you using? 3.4.0

Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,
Android 5.0)
Samsung Galaxy S 3 ~ Samsung Galaxy S 7 (APK 18~23)

Does the same happen on other devices or an emulator?
not problem

Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?

In the case of an error do you have a stack trace or adb logs?
not error

@chanisrunnin
Copy link
Author

I solved problem, so i closed this.
Thank you.

@tiagotrcz
Copy link

How did you solve it?

@Taewan-P
Copy link

@chanisrunnin You should at least leave a comment about how you solved it, for the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants