如何将条形码扫描仪嵌入到我的应用程序中?
我如何将条形码扫描仪嵌入到我的应用程序中,以便当我启动应用程序时,条形码扫描仪屏幕实际上是另一个活动的一部分..条形码扫描仪屏幕本身应该是屏幕之一..在顶部我应该是能够从我的自定义活动控制文本视图,并在底部控制来自 zxing 库的条形码扫描仪...我知道的一种方法是使用片段..但是我想支持从 2.2 开始的所有平台,这是不可能的在这种情况下..请帮助任何人,如果任何人都有答案...
How can i embed the the barcode scanner into my application such that when i start the application, the barcode scanner screen is actually a part of another activity.. the barcode scanner screen itself should be one of the screens.. on top i should be able to have a textview controlled from my custom activity and at the bottom the barcode scanner which is from the zxing library... One way i know is using fragments.. but then i want to support all platforms starting 2.2 and that wont be possible in this case.. Please help anyone, if anyone has the answers...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您的 Activity 需要扩展 ActivityGroup。我认为我在这个问题中的回答包含详细信息:
在 Android 上使用 Fragments 的选项卡,但在另一个布局内
一个大问题是 Google 计划弃用 ActivityGroup 类。我理解他们为什么创建 Fragment,它们很重要。但我仍然认为像你这样的情况需要 ActivityGroup 。
To do that, your Activity needs to extend ActivityGroup. I think my response in this question contains the details:
Tabs using Fragments on Android, but inside another Layout
A big problem with this is that Google is planning to deprecate the ActivityGroup class. I understand why they have created Fragments, and they are important. But I still think ActivityGroup is needed for cases like yours.