如何将条形码扫描仪嵌入到我的应用程序中?

发布于 2024-12-20 18:27:59 字数 200 浏览 3 评论 0原文

我如何将条形码扫描仪嵌入到我的应用程序中,以便当我启动应用程序时,条形码扫描仪屏幕实际上是另一个活动的一部分..条形码扫描仪屏幕本身应该是屏幕之一..在顶部我应该是能够从我的自定义活动控制文本视图,并在底部控制来自 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜中书 2024-12-27 18:27:59

为此,您的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文