Android Question One or more Activitys?

Nilzzz

Member
Licensed User
Longtime User
Hello,

can someone please give me a short summary in which cases i should use one activity and when more activitys are usefull?

I have read the "Android Process and activities life cycle" thread but I do not understand quite the advantage in the use of multiple activitys. The search function has unfortunately also not helped me.

Thank you very much!
 

mangojack

Expert
Licensed User
Longtime User
There is no set rule/case to use 1 vs multiple activities. Probably the major factors would be size/complexity of your project/app.
As your project grows ,its generally considered better to have multiple activities as it is easier to handle and work with your code and layouts.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
The advantage of multiple activities is to keep your code separate, not load unneeded objects. If there is no link between the logic you should use multiple activities.
The only disadvantage I see with (well-written) multiple activity code is the slight delay when switching activities.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Quoting Klaus from the above link Best Practice: multiple activities vs. multiple panels
I recommend using separate activities, thats the way Android was designed for. It's much easier to manage the code.
But it can depend on the kind of application you want to write.
yesterday I wrote a small personal app .. most basic,with minimal code. But it was more simpler to use multiple activities vs hiding /showing panels etc.
Only you will know the best approach as your app develops.
 
Upvote 0
Top