|
|
|
|
|
by on_and_off
4057 days ago
|
|
>At least, that's what happens if activities are used as intended. Activities are indeed the piece of the framework I would be most eager to see removed/revamped.
I have seen many devs (even supposedly experienced ones) use/encourage to use patterns that lead to leaking the Activity context (like retaining everything, especially the UI).
There will always be people writing awful code, but Activities may too hard to grok for many devs (and that's not their only issue by far). |
|
There is brilliant article from Squareup about that - https://corner.squareup.com/2014/10/advocating-against-andro...
In Anvil I try to follow Square's approach, e.g. keep components as viewgroups and use a custom backstack to manage them as needed (e.g. back/home navigation, multi-pane layouts etc). Then you get just one activity per application and it's a big relief.