In Jetpack Compose with Navigation Compose, do I no longer need to create a new activity for each screen?

huangapple go评论55阅读模式
英文:

In Jetpack Compose with Navigation Compose, do I no longer need to create a new activity for each screen?

问题

我不是一位优秀的Android开发专家,我仍在学习。当我开始学习Jetpack Compose时,我有这个问题。以前,在View系统上,当我需要创建一个新屏幕时,我会创建一个新的活动(activity)。但现在有了Navigation Compose,我觉得这样做没有必要。我理解得对吗?随着Navigation Compose的出现,对于大多数应用程序来说,一个活动足够了(除了一些特殊情况)吗?

英文:

I'm not a good Android Dev specialist, I'm still learning. When I started learning Jetpack Compose, I had this question. Previously, on the View system, when I needed to create a new screen, I created a new activity. But now that Navigation Compose exists, I don't see the point in doing so. Do I understand correctly that with the advent of Navigation Compose, one activity will be enough for most apps (except for some specific cases)?

答案1

得分: 1

在Jetpack Compose中,使用一个Activity和多个屏幕非常容易,正如您在大多数应用中提到的那样,单个Activity通常足以完成所有工作,随着您对Jetpack Compose的熟悉,您会更倾向于使用单个Activity和多个屏幕。

英文:

Yes in Jetpack compose it is very easy to use one Activity and multiple screen and it uses very often as you mentioned in most app single activity will be enough to do all of your work and as you get used to Jetpack compose you prefer to use single activity and multiple screen.

huangapple
  • 本文由 发表于 2023年5月10日 16:41:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76216467.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定