Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

2 fatal problem while using service to register the presenter object  #201

@superme001

Description

@superme001

problem path: open an Activity(names A, using mortar MVP), then open Activity(B) form Activity(A), and then open a new Activity(A) from Activity(B) , then click back twice, you will see, the presenter object in Activity(A) does not work, the reason list below:

the presenter object is registered by service in the Activity(A), when opening a new Activity(A),the new presenter object is not registered, the reason is obviously below:

image
so, problem 1.
when the second HelloView get the presenter object using method getSystemService, the result is the same reference to the first HelloView's presenter, you will know that ,the presenter object that the second Activity(A) referenced has no view been attached.
problem 2.
do as below:
image
close the second Activity(A), the HelloView detach from the presenter by method dropview, cause the presenter object is the same reference with the first Helloview's, so when back to the first Activity(A), you will see that the presenter has no view attacted, so it does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions