Too many Activities in Android?

While creating complex applications you definite need to create many activities. So it depends on your application how many activities you need. No of activities in a project do not affect the performance.

The effect is produced by the number of activities in the stack of your android. So it is better to keep 5-6 activities in the stack(Finish activities if they are not needed any more).

So create as many Activities as your application demands but keep smaller no of Activities open at a time.


If your project has many activities but some activity is not important,it means that you do not need any activity after another activity start.

In manifest file set : android:noHistory="true"

Example:

Activity1 -> Activity2 -> Activity3 -> Activity4..................-> Activity20

In manifest file:

  activity android:name=".Activity1" android:label="@string/app_name" android:noHistory="true"

if u call again Activity1 using Intent than set finish() before startActivity()

I think this can help you