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:
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:
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.
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:
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: 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.