On Sat, May 28, 2016 at 1:20 PM, Amitai Rosenberg <amitai...@gmail.com>
wrote:

> Thanks. It says there like I wrote. My question is- why? Why don't they
> suggest to use a fragment also for a small screen device, and just replace
> fragments?
>

Having one activity manage two fragments on a phone (or small screen
device) adds complexity and responsibility to that Activity. Ideally each
Activity does exactly one thing represented by a screen - either showing a
master list or showing the details of item, in this case.

This also makes it easier to test and re-use. Suppose you want to jump into
an item detail from somewhere other than the master page (deeplinking for
example). If you have the one activity now it has to handle deeplink logic
then bypass the first screen to move to the detail fragment. Then what
happens when you go back? You shouldn't be going back to master (that's
"up"), so now you're jumping through hoops to get the desired behavior.
Keep them separate and life is ultimately easier.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CANCScggbU14kSGjGoceft7HaaXt4x47LEWy1yc39s%3D6RXGE5zA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to