performance - Should I replace Android Activities by Fragments? -
i have large android game in there activity each logical screen. (splash screen, start screen, level chooser, game screen , settings distinct activities). working fine right now.
if rewrite there 1 activity , logical screens fragments, reduce ram or cpu consumption?
after years (two+) of saying "fragments way go", never replace activities fragments again.
using fragments rehuse components fine. using fragments dialogs fine, have realized how awful fragment implementation is, how awful fragment lifecycle , how unpredictable (and buggy) fragmentmanager tends under circumstances. go ahead spend time googling around , find "edge not edge" cases hacks have implemented work around "by design" buggy behavior.
sometimes have extend or copy source code of these classes android source code modify private or protected field…
don't me wrong, fragments work. not solution problems (they possibly source of new ones in mid-long term). if have activities, enjoy that! in fact, new transition frameworks shared elements clear indication google wants use more activities ;)
this personal opinion after working in 6 mid-large sized android projects (some popular , you've used them!) ;)
Comments
Post a Comment