The Presenter must hold a reference to the Interface of the Viwe layer and the Interface of the Model layer, while the View layer holds a reference to the Interface of the Presenter layer. The activity is equivalent to the View layer, so you need to instantiate it in the activity. The Presenter implementation class passes the context in. In this way, after you load the data in the Presenter implementation class, you can directly call the Interface method of the View layer. If it prompts that the loading is successful, but the loading success and other methods are implemented in the activity, because the activity is equivalent to the View layer. My humble opinion on the Interface implementation class, please correct me if you understand it wrong
Just write a getContext function in View
Just pass it over. The interface actually defines a specification, which can increase maintainability in large projects.
The Presenter must hold a reference to the Interface of the Viwe layer and the Interface of the Model layer, while the View layer holds a reference to the Interface of the Presenter layer. The activity is equivalent to the View layer, so you need to instantiate it in the activity. The Presenter implementation class passes the context in. In this way, after you load the data in the Presenter implementation class, you can directly call the Interface method of the View layer. If it prompts that the loading is successful, but the loading success and other methods are implemented in the activity, because the activity is equivalent to the View layer. My humble opinion on the Interface implementation class, please correct me if you understand it wrong