Android: Modern Application Flow with Activitys and Fragments
<p>I am searching for good practices in terms of software design / architecture, implementing an application flow for an app in android.</p>

<p>I've got an messenger app with several areas:</p>

<ol>
<li>Login / Signup</li>
<li>Contact List</li>
<li>Conversation</li>
<li>Online Status Selection (like Online, Away, DND and so on)</li>
<li>Settings</li>
</ol>

<p>and some minor "dialogues", for example forwarding attachments and messages.
The app is using ActionBarSherlock for targetting Android 2.0.</p>

<p>In former versions of this app, it was designed to have only one activity and some fake-fragments to achive a custom navigation path:</p>

<p>Login: Tapping Back closes application; can go either to contact list or signup
Signup: Tapping Back closes application; can go either to contact list or signup
Contact List: Tapping Back hiding application; can go either to conversation, online status or settins
Conversation: Tapping back goes back to Contact List; can go either to online status or settings
Online Status: Tapping back goes back to where you was before; can go either to settings or to contact list after selecting status
Settings: Tapping back goes back to where you was before; goes nowhere but to settings [grouped]</p>

<p>Now I want to do it "right", using activitys and fragments, but as it seems, my idea to use one activity and several fragments to achive this navigation (which seems to be well done to the users and gets much reputation) but this seems to collide with our tablet mode, which shows depending on the location a sidebar:</p>

<p>Login: no sidebar
Signup: no sidebar
Contact List: Contact list is sidebar, "main" area is empty
Conversation: Contact list is sidebar
Online Status: No sidebar
Settings: Setting group overview is on the sidebar, selected group is in the main area</p>

<p>Showing and hiding the sidebar is currently done via setContentView, simply picking a layout without the sidebar in large-landscape. But this does nearly "random" things, when I switch between landscape and portrait orientation, completely mixing up the views of the fragments because they are shown in the wrong way (for example showing both sidebar and main area in a layout without sidebar results in showing both layouts stacked up on each other)</p>

<p>So am I right that the "correct" solution would be using multiple activitys for each area mentioned above, implementing the "correct" layout for this area (either sidebar or non-sidebar)?</p>

<p>How do I achive that the login gets kicked from the applications backstack after logging in?
How do I achive to provide the same navigation paths?</p>
