我应该把活动变成碎片吗?

发布于 2025-01-28 12:20:17 字数 208 浏览 2 评论 0 原文

我去了Kotlin Android开发的YouTube学院,并使用Google Firebase创建了一个半复杂的应用程序,我使用需要绑定的扩展AbledableListView在某些代码中遇到了障碍。

在进行了一些研究之后,人们似乎使用碎片而不是单独的活动,因为过去十年。
我应该将所有活动(除了主要)转换为碎片吗?
是否有性能好处?
进行这种更改有多困难?

I went to the YouTube Academy for Kotlin Android Development and created a semi complex app with Google FireBase, I have hit a roadblock in some code using an ExpandableListView that requires bindings.

After doing some research It seems that people use fragments instead of separate activities since like the past 10 years.

Should I convert all of my activities (besides main) to fragments?
Is there performance benefits?

How difficult is it to make this change?

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

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

发布评论

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

评论(1

野侃 2025-02-04 12:20:17

实际上,这更多的是开发利益,而不是绩效益处。碎片和活动不仅是显示一些屏幕。这更多。您可以检查 this thistead octivities"> this 有一些理解为什么要使用片段的问题。
现代Android开发中也有一个流行的概念,称为“单活动架构”。 Please read

Actually this is more about development benefits rather than performance benefits. Fragments and activities are not just about showing some screens.This is more. You can check this and this questions for some understandings why to use fragments.
There is also a popular concept in modern android development called "Single Activity Architecture". Please read this and this articles for having a good understanding. I think you will get all your answers.

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