Android应用程序结构

发布于 2024-12-09 20:29:19 字数 464 浏览 1 评论 0原文

我目前正在为我的大学开发我的第一个 Android 应用程序。该应用程序的结构是有 5 个特定选项卡,每个选项卡在该选项卡内时都会为您提供执行其他操作的多个选项。例如,当您单击选项卡 1 时,您可以选择查看新闻源、twitter 源、rss 源等。选项卡 2 可能会为您提供有关学校不同部分的信息,因此可能有一个按钮可以转到大约一个月前,我开始使用 TabActivities 中嵌套的 ActivityGroup,并取得了良好的进展。然后有一天,我发现这两个类都已被弃用,并且建议使用 Fragments 来代替,所以我重新开始使用 Fragments。所以我的问题是,任何人都可以为我提供有关我想要实现的目标背后的整体结构的指导吗?现在,我使用片段设置了基本选项卡,但这不允许我在选项卡内运行活动,更不用说在各个活动之间切换的选项了,所有这些活动都在各自受尊重的选项卡中。

我已经工作很长时间了,我只需要一些指导,因此我们将不胜感激。感谢您抽出宝贵时间,如果您需要任何其他信息,请告诉我。谢谢。

I'm currently working on my first ever Android application and it's for my University. The structure of this app is that there 5 specific tabs each of which when inside that tab give you multiple options to perform other actions. So for instance when you click on tab 1, you are given the option to view a news feed, twitter feed, rss feed, etc. Tab 2 might give you information about different parts of the school, so there might be a button to go to Academics Info, another button for Financial Info, etc. I started on this about a month ago and was making good progress using ActivityGroups nested inside TabActivities. Then one day I found that both of those class had been deprecated and it was suggested that Fragments be used instead, so I restarted using Fragments. So my question is can anyone give me guidance on the overall structure behind what I'm trying to accomplish. Right now I have my basic tabs setup using fragments, but that doesn't allow me to have activities running inside my tabs, let alone the option for switching between separate activities all in their own respected tab.

I've been working for a very long time and I just need some guidance, so any help is appreciated. Thank you for your time and if you need any additional information please let me know. Thanks.

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

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

发布评论

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

评论(1

苦行僧 2024-12-16 20:29:19

我确信您已经阅读了 TabActivity 的文档。最重要的是,每个选项卡的“活动”应替换为“片段”。活动现在更像是一个上层建筑,它可以包含多个片段,每个片段都有自己的视图。其背后的原因是它使您的应用程序更加模块化。您可以将片段作为手机上的选项卡,但在更大的屏幕等上彼此相邻。

Im sure you've read the documentation on TabActivity. Bottom line is that the Activities you had for each of the tabs should be replaced by Fragments. An activity is now more of a superstructure which can contain multiple fragments each with their own views. The reason behind it is that it makes your application more modular. You could have the fragments as tabs on the phone, but next to eachother on bigger screens etc.

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