Davor
Davor

Reputation: 1396

Is there any significant overhead in using FragmentActivity over normal Activity in Android?

There isn't much to say here beyond title question.

There are some activities in my application that do not use Fragments, so I was wondering if there was any performance difference in using plain Activity in those cases, or should I just always go with FragmentActivity for the sake of consistency?

Upvotes: 4

Views: 366

Answers (1)

wtsang02
wtsang02

Reputation: 18863

If you aren't using any FragmentActivity-specific properties or methods, then it will just be nearly the same as a normal Activity (premature optimization). If you have finished programming the FragmentActivity and you are able to just switch to extending Activity instead, then you should change it to extend Activity, because if your app sells well and you want to add more features to it and later on you decide to change your normal Activity (but you extend it with FragmentActivity) to SomeOtherTypeActivity then most likely you will need to change your code somewhere else to fit the new implementation. But if you don't mind this, then staying with FragmentActivity shouldn't cause you performance hits.

Upvotes: 1

Related Questions