To my mind,
- The role of an
ActivityMapper is to return an Activity from Place to you. - The role of the
ActivityManager is to start the Activity returned from the ActivityMapper and stop the current one if it is different. In your case, you want to “update / update” the current Activity .
Therefore, I would modify the ActivityMapper so that it always returns the same instance of Activity for the given Place type. A good way to do this could be to use the GIN and use the Singleton scope ...in(Singleton.class) to enter your Activity .
If you do this, if you change the URL, if the place remains the same (which means that your URL has the same word after # and earlier :), so that the Type of your place remains the same, ActivityMapper will give you return the same an instance of an Activity so that the ActivityManager does nothing on the Activity . Check l.126 from ActivityManager
if (currentActivity.equals(nextActivity)) { return; }
You have 2 options for me. The first, as Thomas said, is to listen to PlaceChangeEvent in your Activity . The new Place that you receive may have new parameters internally based on the new url, and you can "refresh / refresh" your Activity .
The second, which more closely matches the Activity / Place pattern, is to change the ActivityManager so that it invokes the Place method in the Activity when the Activity returned by the ActivityMapper the same as the current Activity .
I have not tried any of these solutions yet, but soon ... Perhaps I can update this post at that time.
You can find additional information in this article that I wrote on my blog on this topic.
Here is a small outline I made to help me figure out the template, hope this helps:

source share