I'm trying to know which is the better implementation of the view on MVP. For example in small Apps, It's better to use one or two activity's and use as a View the Fragments? or It's better use one Activity for all screens as View without any Fragments?
-
If you have side menu, go with fragments, remaining all cases activity is better – srinu Apr 10 '18 at 10:12
2 Answers
One definition of MVP (there are quite a lot) states, that the presenter is an implementation detail of the View. So, MVP per se has no preference for either of Activity or Fragment. You can attach a presenter to both of them equally well and use it to separate business logic from the presentation layer.

- 23,362
- 7
- 71
- 86
Whether you should use activity or fragment not actually depends on MVP. This decision should be taken based on your app's requirement. If the app is such that the pages do not have much to share between them and pages are quite unique based design and functionality, you should go for activity. On the other hand, if there are lots of interactions going on between the pages or based on design and functionality lots of similarity is found between the pages, using fragments will be a better option. It will reduce lot of duplicate codes.

- 385
- 2
- 12