I\'ve been following MVP design pattern provided by Google to refactor my application. I have one MainActivity and many Fragments and it seems little be messy for me to create
As you can see in Google's samples (https://github.com/googlesamples/android-architecture), Activities create Presenters. Also Views attach to Activity and Presenters get views (Fragments) as parameter.
After Fragment transaction committed or Fragment (view) state restored Presenters get created and take Fragments (views) as parameter than call
view.setPresenter(T presenter);
methods of views and Presenters get registered to view.
I think creating Presenter in Fragment is not a good practice. First of all they are separate layers. This is illegal for Separation of concerns. And second, if you create presenter in Fragment, you bind your Presenter's life to view's LifeCycle and when Fragment is destroyed and recreated, you create a new presenter but they're different layers.
The model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
The presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
The view is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.
So Activity can act as an overall controller which creates the Presenters and Views and connect them.
If we talk about your question, yes you can register presenter in fragment. But you should avoid creating presenters in fragments which you use as a view.
But there're lot's of different approaches about MVP pattern in Android community like below. https://plus.google.com/communities/114285790907815804707
Why activities are not ui elements? http://www.techyourchance.com/activities-android/