Android——我应该使用多个活动还是多个内容视图。

时间:2022-11-27 06:53:45

i'm new with android.

我刚与android。

I'm working on an application using xml layouts. I wish to know which is better: 1. Use few activities and change its contentview 2. Use an activity for each 'view' needed

我正在开发一个使用xml布局的应用程序。我想知道哪一个更好。使用很少的活动并更改它的contentview 2。为每个“视图”需要使用一个活动。

If both works, in which case which option would be better?

如果两种方法都有效,哪种方法更好?

thx a lot

thx很多

1 个解决方案

#1


6  

The general rule would be to use multiple activities. That's the way it's meant to be and you won't be breaking navigation (e.g. going to the previous "screen" by pressing back button).

一般的规则是使用多个活动。这就是它的意义所在,你不会破坏导航(例如,通过按下后退按钮进入先前的“屏幕”)。

#1


6  

The general rule would be to use multiple activities. That's the way it's meant to be and you won't be breaking navigation (e.g. going to the previous "screen" by pressing back button).

一般的规则是使用多个活动。这就是它的意义所在,你不会破坏导航(例如,通过按下后退按钮进入先前的“屏幕”)。