Raigex
Raigex

Reputation: 1215

Is having a lot of Activities ok

I am wondering if having a lot of Activities is better than having a lot of different logic inside one activity.

My dilemma: I am creating an application at work, if I use separate Activity for each major implementation in it (eg 5 activities with video players but each needs a separate logic to it or even 2 video players in same activity) then I will end up within the range of about 40 activities if not more. On the other hand the logic that I can separate (eg Video player) i put into its own library so it can be called from any activity. But if I put similar Items in the same Activity the code for it would run into the couple thousand lines and be difficult to debug.

So I guess my question is having a lot of Activities ok (the activity stack will have 8 activities at the max) or will this slow down my application significantly.

Thanks for your help in advance.

Upvotes: 1

Views: 81

Answers (1)

kosa
kosa

Reputation: 66637

It should be OK. Number of activities loaded won't impact any performance (as long as they are with-in memory allocated for that process). If required Dalvik GC unused objects.

Upvotes: 1

Related Questions