When i started my Android project i had a misunderstanding that every screen that\'s shown in the application must be a new activity. Now i am finished with the project , i have
The Android system tries to maintain an application process for as long as possible, but eventually needs to remove old processes to reclaim memory for new or more important processes. This applies to Activity
s that are running in the background... old Activity
s are managed for you and are destroyed when the system needs to reclaim memory for new processes.
That being said, I think there are two things you should consider:
User experience. Does your app really require 15-20 Activity
s? Can you cut down the number of screens somehow? Less Activity
s is usually better, since it requires less interaction when the user is navigating the application.
Code design. While each Activity
will have its own separate class, this does not restrict you from making smart design-decisions when implementing your application. For example, you might try grouping similar Activity
s by having them extend an abstract class
. As Android projects grow in size, they become more difficult to manage. Sharing code amongst similar classes in this manner will ensure that you can make simple changes to the core of your application without too much trouble.