ViewPager可以替代ActivityGroup吗?

发布于 2024-12-17 13:23:48 字数 291 浏览 5 评论 0原文

我正在做一个类似于 Viber 或 Linphone 的应用程序,基本上是一个 SIP 应用程序。我在屏幕底部有一个主选项卡主机。在每个选项卡中我设置了不同的活动(例如历史活动)。我已经使用 ActivityGroup 完成了此操作。这是正确的做法吗?正如我所看到的,ActivityGroup 已被弃用,但我不想使用片段(大多数手机不支持 API 11)。我见过 ViewPager 组件,是否也可以作为替代方案?我想我可以用手指将 onFlip 事件更改为特定按钮上的 onClick 事件。我使用 Activitygroup 做得正确吗,还是应该更改为其他组件?

I am doing an application similar to Viber or Linphone, a SIP application basically. I have a main tabhost at the bottom of the screen. And inside each tab I set different activities(for example the historic). I have done this using ActivityGroup. Is that the right approach? As I have seen that ActivityGroup is deprecated, but I dont want to use fragments(most of phones dont support API 11). I have seen the ViewPager component, could be also an alternative? I guess I can change the event onFlip with my finger for the onClick on a specific botton. Am I doing it right using Activitygroup, or should I change to another component?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

孤独岁月 2024-12-24 13:23:48

通常,您所描述的那种事情可以使用简单的 TabActivity 来完成。

我不确定您为什么决定使用 ActivityGroup,但是关于您对片段的犹豫 - 您可以使用 兼容性库,它将为您提供对旧平台的片段支持,尽管有一些限制。

Usually the kind of thing you are describing can be done using a simple TabActivity.

I'm not sure why you decided to use ActivityGroup, but regarding your hesitation related to fragments - you can use the Compatibility library, which will give you fragment support for older platforms, albeit with some limitations.

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