Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's a problem with Registry class #21

Closed
cosic opened this issue Dec 9, 2015 · 0 comments
Closed

There's a problem with Registry class #21

cosic opened this issue Dec 9, 2015 · 0 comments
Assignees

Comments

@cosic
Copy link
Collaborator

cosic commented Dec 9, 2015

In u2020-mvp as example of app the Registry looks like a good solution for attachment/detachment a view to presenter. But for production app there's problems with attachment view to presenter when I try to open the same activity that already has existed in activity stack with Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP flags.

For example, there're in activity stack:

Activity A1 (ViewA1, presenterA1)
Activity B (ViewB, presenterB)

And I add new Activity A:

Activity A2 (ViewA2)

So, I haven't had the attached presenter.

What it's happened when I made startActivity(ActivityA.class):

ActivityA2.onCreate(); /* Created a new presenter for Activity2. 
Generated key in Registry class. This key the same like as at 
Activity1 presenter. So it will be replaced. */
ActivityA2.onStart(); /* Look for the existing presenter by key 
and makes the attachment the view to presenter. */
ActivityB.onStop();
ActivityA1.onStop(); /* Look for the presenter by key and makes
 the detachment view from presenter. */

So, we got ActivityA2 with presenter without attached view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant