3

I've read this and this about using Fragments.

There is an example for how to handle multiple Fragments on a tablet and handset with separate Activities for each Fragment (long story short):

With each item of ListFragment 'A', a new Activity for displaying Fragment 'B' is started.

What is the advantage of using separate Activities for each Fragment instead of using Transactions?

4

2 回答 2

0

如果您想将您的应用程序移植到可能不使用片段的手机,因为屏幕太小而无法显示彼此相邻的 2 个片段 - 使用活动可以让您非常快速地移植它 - 只需为每个片段打开另一个屏幕同时显示片段

实际上,这就是您提供的第一个链接的“设计理念”部分的含义

于 2012-08-25T19:48:35.910 回答
0

I see none. If my app runs on tablet I put more fragments on the screen as there's room for this and I got just one activity in which I replace fragments when needed. When it is launched on the phone I got less fragments I still follow that pattern - I got single activity and replace fragments in it. I see benefits of that approaches vs using many activities like less flickering, have one logic for whole app.

于 2012-08-25T23:48:42.473 回答