title: How Fragments affect the Activity "single, focused thing that the user can do" principle?
body: <p>As Android documentation states: "An activity is a single, focused thing that the user can do."</p>
  
  <p>However with Fragments we will be able to do many "things" within the same Activity as <a href="http://blog.radioactiveyak.com/2011/02/strategies-for-honeycomb-and-backwards.html" rel="nofollow">Reto Meier suggest</a>. His suggestion is to replace a selection fragment by a content fragment within the same Activity (section "Within our code this produces a dilemma").</p>
  
  <p>Lets say my application is a "bit" more complex, with many activities, with a complex navigation tree and designed with the "single, focused thing that the user can do" principle in mind.</p>
  
  <p>Lets say now I have to adapt it to Fragments and large screens... and that I don't want to create a second application, neither have two completely different logics (one for phones other for tables) inside one application.</p>
  
  <p>Should I have one Activity to manage all the application fragments and fragment transactions? Like Retro Meier suggest above. Is that the recommended path to follow? Thus breaking with the "single, focused thing that the user can do" principle for Activities?</p>
  
  <p>Or am I missing something? I hope ;)</p>
  
  <p>BTW, I think Fragments looks great, but from what I have seen till now, only if you are creating an application from the scratch. Because making applications to be compatible with phone and tablet looks like going to be a bit tedious. Hope to be wrong :)</p>
  
  <hr>
  
  <p><a href="http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html" rel="nofollow">Dianne Hackborn already has answered</a> (thx for the link mgv):</p>
  
  <blockquote>
    <p>you could put your entire application in one activity in which you change the fragment structure as its state changes</p>
  </blockquote>
  
  <p>So then Activity becomes a sort of container where you will be able to plug Fragments. I like the approach, but... in my app there are about 30 different operations available, each one requires about 2 to 4 screens steps to be performed(forms and selection lists), all of them differ and there are also navigation restrictions. It works fine with Activities each one handling one screen/step behaviour.</p>
  
  <p>So then to port to Fragments I should move each screen logic to Fragments and use Activities as containers for each operation. Thus leaving Activities as the ones managing the navigation between Fragments for every operation, right? Looks like going to be a pain to adapt long applications. :(</p>
  
  <p>Current Activity definition should change a bit btw. :)</p>