Say I have this layout file here. Which is more efficient and a better practice : To use a fragment or just a frame layout and toggle visibility? This is only an example. What if the use-case scaled significantly, which would be a better solution?
Asked
Active
Viewed 31 times
0

Chain Cross
- 351
- 1
- 2
- 12
-
To me, using a Fragment in this situation seems overkill. I would use a ViewSwitcher. Much simpler and no need to deal with all the lifecycle BS https://stackoverflow.com/questions/4106071/how-to-use-android-viewswitcher – MSpeed Apr 02 '19 at 12:49
-
As well as handling communication between fragments and activities implementing interfaces, etc. Are there any advantages tho? – Chain Cross Apr 02 '19 at 13:17
-
Not that I can think of. I think it would just mean writing and maintaining more code. – MSpeed Apr 02 '19 at 13:27