I have an app which displays a map in its main activity which sub-classes SherlockFragmentActivity because I am using ActionBarSherlock.
The action-bar has a drop down list which gives the user the option to select either view mode or edit mode. View mode is the main activity which shows the map, Edit mode will look the same (as in it displays the map) but it allows the user to edit the map and will have some different buttons on the action bar.
I am not to sure about the best way to do this. Should the two modes be in completely separate activities so when the user presses Edit mode the edit map activity will load through an intent?
This seems like it would work however it would have to initialise the action bar again as well as the map which seems like a waste of code and time.
Any suggestions?
Thanks
This depends largely on the difference between those states.
If the edit mode only adds additional input methods (extra buttons for example), I would use the same activity (even the same Fragment), and only set a variable to save the current mode.
Only of both modes are fundamentally different (different rendering, completely different layout) I would make an extra Activity/Fragment (and try to put as much common code as possible in a parent class.