4

Why hasn't Google told us 5 years ago that we should use fragments whenever possible so it won't be a pain in the arse to add a navigation drawer?! 😥

Comments
  • 0
    @Artemix in 2017. By now, 2012 Android code is considered legacy
  • 0
    For me who is just discovering Java and android programming, fragments are horrible. I avoid them the most I can
  • 1
    For the love of God do not use fragments. Look for a decent MVP or MVVM setup or design one yourself. When a designer expects you to build something stupid like a full app flow into a drawer that can appear in any activity you'll thank me.
  • 0
    The massive overhead that comes with needing FragmentManagers everywhere and the complexity of the Fragment LifeCycle are the biggest two. Fragments cannot be nested more than two layers without becoming a mass of transactions and overlapping lifecycles. Strip it down to a Pojo ViewModel that takes its data in its constructor and uses simple View inflation and animation and you can nest them 20 deep with very little effort.
Add Comment