Android: What is better - multiple activities or switching views manually?
I would say that multiple Activities almost always makes more sense. I just don't think Android is designed for constantly switching its own views - you miss out on so much. You have to implement Back yourself, you don't get any inter-Activity transitions, you have to implement a lot of internal logic to resume an application in the correct state. If you don't partition your app into Activities, it makes it a lot more difficult later on to change the flow of your application. It also results in one mega-Activity that can be a lot harder to handle than a lot of smaller pieces of code.
I have trouble imagining that speed is really an issue; if it is then there's something wrong with the way you're initializing each Activity. For example, I used try to pass Serializable objects between Activities, and that proved to be incredibly slow; when I switched to a faster method of passing objects, the speed of launching Activities increased immensely.
Also, I think it's telling that the Android guidelines for Activity and Task Design don't mention switching Views at all; it's centered around an Activity-as-View design.
Android - Should I use multiple activities or multiple content views
The general rule would be to use multiple activities. That's the way it's meant to be and you won't be breaking navigation (e.g. going to the previous "screen" by pressing back button).
Fragment switching or Multiple activities?
Afaik, the example of dual pane showed in the official documentation specifies 2 fragments and 2 activities, but this isn't a choice you have to do. Both are required.
- For phones, activity A shows fragment #1 and activity B shows fragment #2.
- For tablets, activity A shows both fragment #1 and #2, and activity B isn't used.
Should app's with multiple layouts have multiple activities to handle each?
I'd say you want to go with the former, in the most cases, but obviously it all comes down to what it is that should be changing.
If you end up having two activities with layouts that only slightly differ, and you have to pass a lot of data between them, then it probably should have been one activity.
But in the most cases, where you're dealing with presenting quite separate things, I'd definitely create one activity for each presentation, so that you don't have to manually handle things like the click of the back button.
Related Topics
Get Response Status Code Using Retrofit 2.0 and Rxjava
Onnewintent() Lifecycle and Registered Listeners
Populating Spinner Directly in the Layout Xml
How to Deal with Different Aspect Ratios in Libgdx
Where Is the All Android Broadcast Intent List
Android Opengl .Obj File Loader
What Is the Meaning of Android.Intent.Action.Main
Achartengine - Can't Figure How to Use Dates as X Axis - the File I Save Is Empty
Sliding Navigation Drawer Not Handling Clicks on Menu Items Android
Android Design Support Library Expandable Floating Action Button(Fab) Menu
How Can One Pull the (Private) Data of One's Own Android App
Configuration on Demand Is Not Supported by the Current Version of the Android Gradle Plugin
How to Move Main Content with Drawer Layout Left Side
Should Accessing Sharedpreferences Be Done Off the UI Thread
Failure [Install_Failed_Update_Incompatible] Even If App Appears to Not Be Installed