开发者

Start a new activity or setContentView?

开发者 https://www.devze.com 2023-03-16 23:02 出处:网络
Is it better to start a new activity or just set a new content view in Android? I usually start a new activity when I have to change the whole environment, but开发者_运维技巧 IMHO I think it\'s too

Is it better to start a new activity or just set a new content view in Android?

I usually start a new activity when I have to change the whole environment, but开发者_运维技巧 IMHO I think it's too onerous when I need to keep the other activity alive in the background.

On the other hand, I could have a single activity and just change the layout when I have to set a new environment.

Which is the better way and why?


Search for 'Pattern one activity, multiple views. Advantages and disadvantages' on stack-overflow and look for the answer by @CommonsWare

0

精彩评论

暂无评论...
验证码 换一张
取 消