Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Tim2411338yFor me who is just discovering Java and android programming, fragments are horrible. I avoid them the most I can -
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.
-
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.
Related Rants

It all makes sense now...
It changed my life, really. 😁
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?! 😥
undefined
android
wk58
java
app
legacy shit
mobile
fragments